spartial
Sparse partial function application - aka, spartial application. Based on the supplied function's apply method
Why?
Good question ... more on that later.
Install
$ npm i spartial -S
Usage
var _ = var {} // apply on the left var fn0 = _ //=> fn('one', 'two') // apply on the right var fn1 = _ //=> fn('one', 'two') // apply and mix on the left var fn2 = _ //=> fn('one', 'two', 'three', 'four', 'five', 'six') // apply and mix on the right. (note, one can define a sparse array // also note, [,] is an array of one element; i.e., the equivalent // of the array literal below would be [ 'two',,,'five',, ] var fn3 = _ //=> fn('one', 'two', 'three', 'four', 'five', 'six')
API
.placeholder([placeholder])
.fix(fn [, this[, args]])
.fixR(fn [, this[, args]])
.mix(fn [, this[, args[, placeholder]]])
.mixR(fn [, this[, args[, placeholder]]])
License
Unlicensed - TBD