This is a Meteor package containing reactive classes. These classes can be used within Meteor to easily create reactive objects, dictionaries and arrays.
Using meteorite do the following:
mrt add reactive-extra
If you don't like using meteorite create the folder packages/reactive-extra/
and can copy the packages.js
and lib/
to it.
A reactive object implementation. Checkout the api docs
var obj = new ReactiveObject({'foo':'1'});
obj.defineProperty('bar', 2);
obj.foo = '2';
obj.undefineProperty('foo'); // Don't use 'delete obj.foo' it will give strange results
A reactive dictionary implementation. Checkout the api docs
var obj = new ReactiveDictionary({'foo':'1'});
obj.add('bar', 2);
obj.count()
obj.foo = '2'
obj.remove('foo'); // Don't use 'delete obj.foo' it will give strange results
obj.clear();
A reactive array implementation. Checkout the api docs.
var arr = new ReactiveArray(1,2,3,4);
console.log arr.length
arr.map(function(v) {
return v+1
}).toArray();
// Be aware that using 'arr[9] = "a"' won't work correctly
// A work around is to use 'arr.length = 10' and then do 'arr[9] = "a"'
A reactive list implementation based on ReactiveArray. This implementation has a custom handlebars each helper extension. Checkout the api docs.
The current cake
commands require the wrench module, on windows the which module is also required.
This command will compile the files in src/
to lib/
.
This command will compile the files in src/
to lib/
, after which it will copy packages.js
and lib/
to example/packages/reactive-extra
.
This command will generate the api docs in docs/
.
To get it working make sure you have docco installed.
- Write a real example not just a placeholder for tests
- Create Harmony Proxy versions of the classes
- Add
observe
and/orobserveChanges
methods when possible - Add more test where necessary