npm.io
0.1.0 • Published 6 years ago

promisely

Licence
MIT
Version
0.1.0
Deps
1
Size
39 kB
Vulns
0
Weekly
0

promisely

Extra utilities for working with ES6 Promise.

GitHub issues

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

API documentation

Keywords