Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jcblw/bound-properties

binds an objects methods to its own context
https://github.com/jcblw/bound-properties

Last synced: 16 days ago
JSON representation

binds an objects methods to its own context

Awesome Lists containing this project

README

        

# Bound Properties

[![Greenkeeper badge](https://badges.greenkeeper.io/jcblw/bound-properties.svg)](https://greenkeeper.io/)

binds an objects methods to its own context

[![Build Status](https://travis-ci.org/jcblw/bound-properties.svg?branch=master)](https://travis-ci.org/jcblw/bound-properties)

## Usage

```javascript
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
```