0.7.0 • Published 10 years ago

flyd-mirror v0.7.0

Weekly downloads
-
License
ISC
Repository
-
Last release
10 years ago

flyd-mirror

A small (0.8 kB min+gzip) module for flyd that can generate mirrors and images, useful when you want to combine reactive programming with plain old JavaScript objects.

Install

npm install flyd-mirror

Examples

image is mirroring streams...

var data = {
  name: flyd.stream("Fry"),
  age: flyd.stream(1023)
};
var image = fm.image(data);
assert.equal(image.name(), "Fry");
assert.equal(image.age(), 1023);

...while mirror is listening to these images...

var sq = fm.mirror(function() {
  return image.age()*image.age();
});
assert.equal(sq(), 1046529);
data.age(1024); // happy birthday!
assert.equal(sq(), 1048576);

making it possible for the mirror to automatically update when the underlying streams are updated.

0.7.0

10 years ago

0.6.1

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago