Create a DedupMap with default options.
DedupMap
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.
T
Optional
const dedup = createDedupMap({ windowMs: 100 });// Both calls below share one network requestconst [a, b] = await Promise.all([ dedup.execute("GET", "/api/users", () => client.get("/api/users")), dedup.execute("GET", "/api/users", () => client.get("/api/users")),]); Copy
const dedup = createDedupMap({ windowMs: 100 });// Both calls below share one network requestconst [a, b] = await Promise.all([ dedup.execute("GET", "/api/users", () => client.get("/api/users")), dedup.execute("GET", "/api/users", () => client.get("/api/users")),]);
Create a
DedupMapwith default options.