courier-array
v1.0.0
Published
Add pub/sub support to arrays using the courier module.
Downloads
5
Readme
CourierArray
Array extension with support for courier publish/subscribe model.
Using the CourierArray class
var CourierArray = require("courier-array"),
arr = new CourierArray();
// outputs: a b
arr.courier.subscribe("add", console.log);
arr.push("a", "b");
Using the courier.array function
var CourierArray = require("courier-array"), // must be loaded so courier is
courier = require("courier"), // decorated with 'array'
arr = courier.array([2, 3]);
// outputs: a b
courier.subscribe(arr, "add", console.log);
arr.push("a", "b");