bind-last

1.0.1 • Public • Published

bind-last Build Status

convert data-last functions into ::-functions

This is a converter function to make a data-last function working with function-bind-operator

Install

$ npm install --save bind-last

Usage

import { bindLast } from 'bind-last';

const data = { id: 1, name: 'foo' };

const hasPropLast = (prop, data) => !!data[prop];
const hasThisLast = hasPropLast::bindLast()


assert.strictEqual(data::hasThisLast('name'), true);
assert.strictEqual(data::hasThisLast('nope'), false);

:: huh?

If you’re wondering what the :: thing means, you’d better read this excellent overview by @jussi-kalliokoski or have a look at the function bind syntax proposal.

License

MIT © Stoeffel

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i bind-last

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • schtoeffel