Function
callOnce
The type of the wrapped function.
The function to wrap.
A function with the same signature as fn, whose body runs at most once.
fn
Wrap a function so its body runs only on the first call. Later calls skip the body and return the first call's result.
const init = callOnce(function () { ... });const out = init(); Copy
const init = callOnce(function () { ... });const out = init();
callOnce