justreactive

0.4.5 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i justreactive

Weekly Downloads

1

Version

0.4.5

License

MIT

Unpacked Size

39.2 kB

Total Files

24

Last publish

Collaborators

  • daniel-mf