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

Readme

Keywords

none

Package Sidebar

Install

npm i bound-properties

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • ~jcblw