Skip to content

thisables/bind-last

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Stoeffel
Oct 30, 2015
b7dfe98 · Oct 30, 2015

History

16 Commits
Aug 4, 2015
Aug 4, 2015
Aug 4, 2015
Aug 4, 2015
Aug 4, 2015
Aug 4, 2015
Aug 4, 2015
Aug 28, 2015
Aug 4, 2015
Aug 4, 2015
Oct 30, 2015
Oct 30, 2015

Repository files navigation

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 @thisables/bind-last

Usage

import { bindLast } from '@thisables/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.

Related

  • bind-first to convert data-first functions into ::-functions

License

MIT © Stoeffel

About

convert data-last functions into `::`-functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published