A collection of utilities for JavaScript functions.
npm install @ultraq/function-utils
A higher-order function to apply memoization, returning a memozied version of the wrapped function.
If memoizing a recursive function, then memoize and define the function at the same time so you can make a call to the memoized function, eg:
const myFunction = memoize(() => myFunction());
- func: the function to memoize