0.1.8 • Published 8 years ago

combine-callbacks v0.1.8

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

combine-callbacks

npm version Build Status Dependency Status Coverage Status

Combine multiple callbacks into one. Divide up code into smaller units. Improve the reusability & make the code clearer.

Installation

$ npm install combine-callbacks

Usage

var combineCallbacks = require('combine-callbacks');

var preventDefault = function(evt) { evt.preventDefault(); };
var dispatchAction = function() { ... };

var onClick = combineCallbacks(preventDefault, dispatchAction);
document.getElementById('elem').addEventListener('click', onClick);

For more examples see the test.

API

combineCallbacks(fn1[, fn2, fn3...])

Returns the final combined callback which receives arguments & context, and then passes them into the original functions.

combineCallbacks(arrayOfFuncs)

You get the idea.

License

MIT License, Copyright (c) 2015 Riophae Lee

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago