0.1.0 • Published 4 years ago
promisely v0.1.0
promisely
Extra utilities for working with ES6 Promise.
import { Lock, after } from 'promisely'
class Foo {
lock: Lock
constructor() {
this.lock = new Lock()
}
async concurrentFunction() {
this.lock.use(() => {
await after(1000, () => {
console.log('this can only run one at a time')
})
})
}
}
📦 Installation
npm install promisely
🚀 Usage
import { Lock, after } from 'promisely'
📖 Docs
0.1.0
4 years ago