This is a fork of Meteor Tracker, the library formerly known as Meteor Deps. It has been repackaged into a standalone library that is ready to use in Node.js and the browser.
Trackr's API is completely backwards compatible with Meteor's version. If you are not familiar with Meteor Tracker, or reactive programming in general, I recommend reading the Meteor Manual entry on Deps. The concepts it teaches apply here as well.
Download the latest version from the release page and use via a script tag. The variable
Trackr will be attached to
For Browserify and Node.js, install via NPM and require as necessary.
$ npm install trackr
var Trackr = ;
The only change that has been made is the addition of function context. Method context (
this) can be added as an optional argument to the end of methods that accept functions. For example, here is how you would use
autorun() with context:
var ctx = foo: "bar" ;var comp = Trackr;
This also works for
onInvalidate() will fallback on the context provided to the computation if none is provided.