prop-factory
Getter-setter factory utility.
Installation
Install using npm:
$ npm install prop-factory
Usage
Borrowed from Mithril's m.prop
, prop-factory is a simple
factory that returns a function for storing and retrieving a value.
var prop = ; // Define a setter-getter with an initial value of "John" (without a given// value, the initial value will be undefined)var name = ; // Read the valuevar a = ; // a === 'John' // Set the value to "Mary"; // Read the new valuevar b = ; // b === 'Mary'
License
MIT