0.4.5 • Published 6 years ago
justreactive v0.4.5
just-reactive
Ultra light-weight JavaScript reactive programming library.
Reactive Variable
const foo = Reactive.var(0);
Reactive(() =>
console.log(foo.get()) //or via primitive call +foo
);
setInterval(() => foo.set(foo + 1), 500);
Reactive Object Properties
const foo = Reactive.object({bar: 0});
Reactive(() =>
console.log(foo.bar)
);
setInterval(() => foo.bar++, 500);
Reactive Proxy Object
const foo = Reactive.proxy();
foo.bar = 0; //every defined proxy property is reactive
Reactive(() =>
console.log(foo.bar)
);
setInterval(() => foo.bar++, 500);
Reactive Array
const foo = Reactive.array(1, 2, 3, 4);
Reactive(() =>
console.log(foo.join())
);
setInterval(() => foo.push(foo.length + 1), 500);
Download the library
Install via npm
$ npm install justreactive --save