@vates/coalesce-calls
v0.1.0
Published
Wraps an async function so that concurrent calls will be coalesced
Downloads
192
Readme
@vates/coalesce-calls
Wraps an async function so that concurrent calls will be coalesced
Install
Installation of the npm package:
> npm install --save @vates/coalesce-calls
Usage
import { coalesceCalls } from 'coalesce-calls'
const connect = coalesceCalls(async function () {
// async operation
})
connect()
// the previous promise result will be returned if the operation is not
// complete yet
connect()
Contributions
Contributions are very welcomed, either on the documentation or on the code.
You may:
- report any issue you've encountered;
- fork and create a pull request.