after-delay runs some code once a period of time has passed with after-delay not being called again in that time.
Do you recognise this code?
Using this library, you can write just this:
var afterDelay = ;;
It's an entire two lines shorter!
The event name should be unique to each event, and when
called with the same name, the old timeout will be cancelled.
afterDelay() without a function will cause the delay to be cancelled.
This behaviour is also aliased to
$ npm install --save after-delay
Released under the MIT license.