1.0.2 • Published 6 years ago

define-binding v1.0.2

Weekly downloads
4
License
X11
Repository
-
Last release
6 years ago

define-binding

Define a property which looks normal but is a binding to another object's field

import defineBinding from "define-binding"
var propertyBag= {a: 1, b: 42}
var o= {}
defineBinding( o, "bByO", propertyBag, "b")

// this binding is enumerable, so it iterates
Object.keys(o).next().value //=> "bByO"

// this binding is configurable, so it can be overwritten
o.bByO //=> 42
o.bByO= 6*9
// o has a new property, original property is intact
propertyBag.b //=> 42
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago