dlmanning / bind

Bind with partial application and memoization
ISC License
4 stars 1 forks source link

@dlmanning/bind

Bind and partially apply functions with memoization.

Install

npm install @dlmanning/bind

Usage

const bind = require('@dlmanning/bind')

function fn (str) {
  console.log(this + ' ' + str)
}

const hi = bind('hello', fn)

hi('world') // => hello world

const yo = hi.partial('earth')

yo() // => hello earth

API

See API.md for detailed documentation.

License

ISC