1.0.0 • Published 5 years ago
share-promise v1.0.0
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
1.0.0
5 years ago