0.1.3 • Published 11 years ago

computed-value v0.1.3

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

computed-value

Stability: 1 - Experimental

Stability as defined by Node.js

A module for creating computed value in reactive programming style.

Installation

npm install computed-value

Usage

Below example can be also found in examples/fullname.js.

var computedValue = require('computed-value');

var first = computedValue('Tom');
var last = computedValue('Dale');
var fullName = computedValue(first, last, function(first, last) {
  return first + ' ' + last;
});

console.log(fullName.value);

first.write('Bob');
console.log(fullName.value);

fullName.on('update', function(updatedValue) {
  console.log('update:', updatedValue);
});

lastName.write('Johnson');

The output of running the above script will be:

Tom Dale
Bob Dale
update: Bob Johnson
0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago