1.0.0 • Published 5 years ago
@jswork/next-memoize v1.0.0
next-memoize
Memoize for next.
installation
npm install -S @jswork/next-memoize
usage
import '@jswork/next-memoize';
const fibonacci = (n) => {
return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
};
const memoized = nx.memoize(
fibonacci
);
// First time: calc
const rs1 = memoized(number);
// Next time: From Cache
const rs2 = memoized(number);
license
Code released under the MIT license.
1.0.0
5 years ago