f-bind

0.1.0 • Public • Published

F-bind

Library mimicking the proposed function-bind operator (::)

Using bind operator

const {unique} = require('some-array-extras-lib')
console.log(
  [1, 2, 2, 4]
  ::unique() // call custom method
  .filter(n => n % 2 == 0) // call native method
  .map(n => n * 10)
) // prints [20, 40]

Using f-bind library

const {unique} = require('some-array-extras-lib')
const $ = require('f-bind')
console.log(
  $([1, 2, 2, 4]) // wrap
  .$(unique)() // call custom method
  .$('filter')(n => n % 2 == 0) // call native method
  .$('map')(n => n * 10)
  .$() // unwrap
) // prints [20, 40]

Readme

Keywords

Package Sidebar

Install

npm i f-bind

Weekly Downloads

1

Version

0.1.0

License

ISC

Last publish

Collaborators

  • phaux