Skip to content

chrisinajar/carly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Carly

A cancelable callback function implementation.

Only let a callback run when if you still want it to, so call me maybe

Installation

npm install carly

Usage

var Carly = require('carly');

var jepsen = Carly(myHandler);

// jepsen.callback is a normal function that can be called
// it will proxy everything into myHandler
doWork(data, jepsen.callback);

/* ... */

// we can cancel the callback at any time with
jepsen.cancel();
// now even if doWork finishes the cb will not be called

Contributing

npm run test

License

MIT

About

A cancelable callback function implementation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published