memoize-promise-value
v1.0.0
Published
Memoize a promise result
Downloads
5
Readme
A simple cached memoize for promises.
Usage
const memoize = require('memoize-promise-value')
const generatorPromise = () => {
return new Promise((resolve) => {
resolve('myValue')
})
}
memoize('myKey', generatorPromise, 'optionalKeyPrefix_').then((value) => {
expect(value).to.be('myValue')
})
Development
npm run watch
# or
npm run build
# please test it
npm test