Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Latest commit

 

History

History
68 lines (40 loc) · 942 Bytes

README.md

File metadata and controls

68 lines (40 loc) · 942 Bytes

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