node-getto-memoize
memoize async function
status: production ready
const memoize = ; const load_heavy_data = async { return key1: "heavy-data" key2: JSON ;}; const memo = memoize; const get = memo;const json = memo; const get_values = async { console; // => heavy-data console; // => { heavy: "data" }};
Table of Contents
Requirements
- Node.js: 10.16.0
Usage
const memoize = ; const load_heavy_data = async { console; return key1: "heavy-data-1" key2: "heavy-data-2" json1: JSON json2: JSON ;}; const memo = memoize; const get = memo;const json = memo; const get_values = async { console; // => heavy-data-1 // => heavy-data loaded // => get value: key1 console; // => heavy-data-1 // (get value from cache) console; // => heavy-data-2 // => get value: key2 console; // => { heavy: "data-1" } // => parse json: json1 console; // => { heavy: "data-1" } // (get value from cache) console; // => { heavy: "data-2" } // => parse json: json2};
Install
npm install --save getto-memoize
License
node-getto-memoize is licensed under the MIT license.
Copyright © since 2019 shun@getto.systems