Need private packages and team management tools?Check out npm Teams »

bound-properties

0.1.1 • Public • Published

Bound Properties

binds an objects methods to its own context

Build Status

Usage

var 
foo = { 
  bar: function( ) {
    return this.baz
  },
  baz: 'qux'
},
baz = foo.bar
 
console.log( baz() ) // undefined
 
baz = bound( foo ) // modifies exsisting ref to foo
 
console.log( baz() ) // qux

Keywords

none

Install

npm i bound-properties

DownloadsWeekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • avatar