Skip to main content
@brushy/di-core deduplicates concurrent async resolves and caches method-level promises to prevent duplicate network or DB calls.

PromiseCache class

Global promiseCache

PromiseCacheSystem and promiseCacheSystem are deprecated aliases.

Provider promiseTtl

Per-provider TTL for cached async method results:

container.getPromise

Uses the resolver’s integrated promise cache for the token/method/args tuple.

cache utility

General-purpose TTL cache (separate from DI lifecycle):
cache.clear(token?) also clears promiseCache entries for the token.

Use cases