naves
v2.0.0
Published
Powerful JavaScript utility library.
Downloads
2
Maintainers
Readme
naves
Powerful JavaScript Utility Library.
Installation
npm install --save naves
Documentation
memoize
memoize<[T1, T2, ...], R>(fn);
Creates new function which memoizes the result of fn
. As a cache key memoization function uses JSON.stringified result of arguments provided to memoized function. If one of arguments include circular reference than memoized function can not cache the result and calculates it in every call.
import { memoize } from 'naves';
...
const memoizedFn: (...args: T) => R = memoize<[T1, T2, ...], R>(fn);
memoizedFn(...args);
License
This project is licensed under the MIT License - see the LICENSE file for details.