- cached<T>(func): ((id: string) => Promise<T>)
Parameters
- func: ((id: string) => Promise<T>)
- (id): Promise<T>
Returns Promise<T>
Returns ((id: string) => Promise<T>)
- A function which upon subsequent calls with the same id parameter returns the result from the first call.
- (id): Promise<T>
Returns Promise<T>
A cache helper to cache single functions and their return variable.