1.0.2 • Published 4 years ago

@rootstream/once v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

once

CircleCI

async friendly version of https://www.npmjs.com/package/once

usage

in your npm console:

npm install --save @rootstream/once

in your code:

const once = require('@rootstream/once');

async function sample() { /* ... */ };
// guarantees sample() is called only and only once during app's lifetime
const sampleOnce = once(sample)
// guarantees sample() is called only and only once during function's execution lifetime
const sampleOnceReentrant = once(sample, { reentrant: true })
1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago