promise-lock
Installation
npm install promise-lock
Usage
- Rejecting concurrent promises
const lock = ; lock //<-- will log the result ; lock ;//<-- will log "Error", because the lock is previously set on anothe promise
- Cancelling previously started promise
const lock = ; lock //<-- will never run ; //<-- will never run lock; lock //<-- will log the result ;