promisely
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i promisely

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

39.6 kB

Total Files

44

Last publish

Collaborators

  • davidwu226