@lucid-softworks/singleflight
v0.1.0
Published
Coalesce concurrent operations by key without caching results.
Maintainers
Readme
@lucid-softworks/singleflight
Coalesces concurrent operations with the same key. Settled results are not cached, so the next call starts fresh work.
import { Singleflight } from "@lucid-softworks/singleflight";
const flights = new Singleflight<string>();
const user = await flights.do("user:42", () => loadUser(42));forget and clear remove deduplication entries without cancelling work.
