0.0.3 • Published 9 years ago

gali v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

gali

partially apply and store like curry

import gali from 'gali';

const fn = gali(function(a) {
  return a + 1;
}, function(a, b) {
  //a is calculated before
  return a + b;
}, function(a, b, c) {
  return b + c;
});

//all the same and return a + b + c + 1;

fn(1, 2, 3);
fn(1)(2, 3);
fn(1, 2)(3);
fn(1)(2)(3);

API

gali(fn, [fn...]);

fn can be empty

gali(null, null, function(a, b, c) {
});
//is the same as
curry(function(a, b, c) {
});

//returns a function that accept 3 params and give the last back
gali(null, null, null);