1.1.2 • Published 9 years ago

deligare v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

deligare

Build Status Coverage Status

A most flexible and powerful function parameter delegation utility.

How does it work?

As easy as this:

var del = require('deligare');
var add = function (a, b) {
    return a + b;
};
var sub = function (a, b) {
    return a - b;
};
var addOne = del(add, [1]);
var subTwo = del(sub, [undefined, 2]);

addOne(5); // -> 6 (equivalent to "add(1, 5)")
subTwo(5); // -> 3 (equivalent to "sub(5, 2)")

How do I get it?

You can use npm install it:

npm install deligare

So it is a nodejs module. How can use it in a browser based app?

Don't worry. The package provides a bundled (and minified) standalone JS file which can be included, e.g.:

<script src="{path}/dist/deligare.min.js"></script>

Alternatively you can use tools like browserify to include it in your project. The lib has no further dependencies and should run fine in any browser environment.

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago