meteor/meteor — pull request #193 by tmeasday (2012-06-19 04:22:44+00:00)
Title: Deps extensions

Hey,

I've created a little package that adds a couple of functions to `Meteor.deps` to abstract out some boiler plate code that I've found I've had to write a lot:

Meteor.deps.add_reactive_variable(object, name, default_value)

Which adds three functions to `object`: `object.name()`, `object.name.set()` and `object.name.equals()` which behave reactively. Much like the session (see below). And:

Meteor.deps.await(test_fn, cb)

Which will set up a context to repeatedly test `test_fn` and then call `cb` when it succeeds. There's more details and an example in the file.

NOTE on session.js:

I found that I was pretty much rewriting a lot of code from the session package, so I refactored session to use deps-extensions. I've added some basic tests too.