@twine-protocol/twine-core v0.1.0 • Docs
twine-js / @twine-protocol/twine-core / memoized
memoized<T>(cache, key, fn, ...args): Promise<T>
T
cache
key
fn
args
Promise
memoize an async function call so that while it is pending, the same call is not made again
This is used by the ResolveCallers.requestCache to avoid making multiple requests for the same twine.
Map<string, Promise<T>>
Map
string
The cache to use
The key to use
(...args) => Awaitable<T>
Awaitable
The function to call
...args
any[]
any
The arguments to pass to the function
Promise<T>
packages/twine-core/src/resolver/helpers.ts:45arrow-up-right
Last updated 1 year ago