share-promise
v1.0.0
Published
share the async result from a function
Downloads
14
Readme
share-promise
share the async result from a function
Getting started
npm i share-promise
Usage
let i = 0
const fn = async () => {
await delay()
i++
return i
}
const sfn = share(fn)
const mmm = await Promise.all([
sfn(),
sfn(),
sfn(),
])
console.log(mmm)
License
MIT