npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

promise-protect

1.0.1

@isaacs

npmHomeRepoSnykSocket
Downloads:0
$ npm install promise-protect
DailyWeeklyMonthlyYearly

promise-protect

Protect promise-returning functions from being called more than once in parallel.

Written during this twitter exchange.

USAGE

const protect = require('promise-protect')

protect(fn, 'name', some, args).then(result => {})
// won't call fn until the last one resolves
protect(fn, 'name', other, args).then(otherResult => {})