ChemPal Documentation - v1.18.0
    Preparing search index...

    Function removePriceAlerts

    • Stops watching products.

      Parameters

      • ids: readonly string[]

        The alerts' ids

      Returns Promise<void>

      Resolves once they are removed

      await removePriceAlerts(['3f9c2a']);
      
      export async function removePriceAlerts(ids: readonly string[]): Promise<void> {
      const keys = ids.map(priceAlertKey);
      const stored: Record<string, unknown> = await cstorage.local.get(keys);
      await cstorage.local.remove(keys);
      for (const { supplier } of Object.values(stored).filter(isPriceAlert)) {
      void trackEvent('price_alert_removed', { supplier });
      }
      }