bloody-transform

1.0.0 • Public • Published

transform

browser support

Build Status

creates partial functions that take one argument

useful for APIs like promises .then which let functions you pass in it take one argument only.

e.g.

var transform = require("bloody-transform")
  , foo = function(fn, value){
      return fn(value)
    }
  , partialFoo = transform(foo, 1, console)
 
partialFoo(console.log)("value")
// logs "value"

install

$ npm install bloody-transform

require

var transform = require("bloody-transform")

api

transform(fn[, index=0, [thisValue]]) -> fn

returns a function that will take all the prefilled arguments and will return a function that takes just one argument and fill the index arguments when executed.

/bloody-transform/

    Package Sidebar

    Install

    npm i bloody-transform

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • bloodyowl