0.1.0 • Published 4 years ago

promisely v0.1.0

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

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