Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
method Cache.prototype.memoize
import { Cache } from "https://deno.land/x/frugal@0.2.1/packages/core/Cache.ts";

For a given key, call the producer function if the key is not present (in hot or cold data).

If the key is present in cold data, call the otherwise function, and propagate the key and its value in hot data.

It the key is present in hot data, call the otherwise function

Type Parameters

optional
V = VALUE

Parameters

unnamed 0: MemoizeConfig<V>

Returns

Promise<V>