kinetex - v1.0.0-rc.1
    Preparing search index...

    Function createDedupMap

    • Create a DedupMap with default options.

      Type Parameters

      • T

        The expected result type of the factory function. Note: T is purely for caller-side type inference — it does not validate the factory's return type at runtime.

      Parameters

      Returns DedupMap<T>

      const dedup = createDedupMap({ windowMs: 100 });

      // Both calls below share one network request
      const [a, b] = await Promise.all([
      dedup.execute("GET", "/api/users", () => client.get("/api/users")),
      dedup.execute("GET", "/api/users", () => client.get("/api/users")),
      ]);