Standalone Reactive Var
A Standalone version of ReactiveVar package from Meteor. Lets you write reactive code with ease outside of Meteor
Install
NPM
npm install --save reactive-var-std
CDN
<!-- OR -->
Usage
ES6
; // or if you do not use ES6// var StdReactiveVar = require('reactive-var-std');// var Tracker = StdReactiveVar.Tracker;// var StdReactiveVar = StdReactiveVar.default; // create a creative var instanceconst reactive = 0; // wrap the reactive instance inside a computation block created by Tracker.autorunTracker; // change the value 1st timereactive;// ---> the console will show: 1 // change the value 1st timereactive;// ---> the console will show: 10
ES5
var StdReactiveVar = ;var Tracker = StdReactiveVarTracker;var StdReactiveVar = StdReactiveVardefault; // create a creative var instancevar reactive = 0; // wrap the reactive instance inside a computation block created by Tracker.autorunTracker; // change the value 1st timereactive;// ---> the console will show: 1 // change the value 1st timereactive;// ---> the console will show: 10