UNPKG

asyncforge

Version:

`asyncforge` allows you to remove singletons from your codebase with the use of [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage).

19 lines (15 loc) 300 B
declare namespace asyncforge { interface Store { run<T>(fn: () => T) : T; enterWith() : void; } export function create () : Store; export function memo<T extends unknown>( name?: string ): { (): T; key: symbol; set: (value: T) => void; }; } export = asyncforge