https://github.com/afeiship/next-memo
Memoize for next.
https://github.com/afeiship/next-memo
memo memoize next
Last synced: 2 months ago
JSON representation
Memoize for next.
- Host: GitHub
- URL: https://github.com/afeiship/next-memo
- Owner: afeiship
- License: mit
- Created: 2018-07-17T08:08:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-01T13:36:17.000Z (almost 2 years ago)
- Last Synced: 2025-01-06T08:08:40.110Z (5 months ago)
- Topics: memo, memoize, next
- Language: JavaScript
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-memo
> Memoize for next.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```bash
npm install -S @jswork/next-memo
```## usage
```js
import '@jswork/next-memo';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](https://github.com/afeiship/next-memo/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/next-memo
[version-url]: https://npmjs.org/package/@jswork/next-memo[license-image]: https://img.shields.io/npm/l/@jswork/next-memo
[license-url]: https://github.com/afeiship/next-memo/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-memo
[size-url]: https://github.com/afeiship/next-memo/blob/master/dist/next-memo.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/next-memo
[download-url]: https://www.npmjs.com/package/@jswork/next-memo