1.0.1 • Published 2 years ago

observable.ts v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

observable.ts 🐜

npm npm bundle size Coverage License

A minimal reactivity library that is

  • ⚡ blazing fast
  • 🛡️ secure (zero third-party dependencies)
  • 🐜 super slim (<4kb)
  • 🔑 fully typed

Installation

yarn add observable.ts

or

npm install --save observable.ts

or

pnpm add --save observable.ts

Usage

// 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.

License

MIT

FOSSA Status

1.0.1

2 years ago

1.0.0

2 years ago