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

    Function flushPendingPriceHistory

    • Force all in-flight recordProductPrices writes to finish, bypassing nothing (there's no debounce to skip) but giving the caller a promise to await before a point where the popup could otherwise close mid-write — e.g. once a search finishes. Also invoked as a visibilitychange backstop below.

      Returns Promise<void>

      Resolves once every currently-tracked write has settled.

      await flushPendingPriceHistory();
      
      export async function flushPendingPriceHistory(): Promise<void> {
      await Promise.allSettled([...pendingWrites]);
      }