A minimal reactivity library that is
- โก blazing fast
- ๐ก๏ธ secure (zero third-party dependencies)
- ๐ super slim (<4kb)
- ๐ fully typed
yarn add observable.ts
or
npm install --save observable.ts
or
pnpm add --save observable.ts
// create the observerable with an initial value
const fontColor = new Observerable('blue');
// subscribe an observer to listen for changes of `color.value`
fontColor.subscribe((newColor: string) => console.log(newColor));
// changes to the value of color will be propagate onto all registered observers
fontColor.value = 'yellow';
// OUTPUT: "yellow"
For more details see the Documentation.
MIT