2.0.5 • Published 4 months ago

observavir v2.0.5

Weekly downloads
-
License
(MIT or CC0 1.0)
Repository
github
Last release
4 months ago

observavir

Flexible and simple observables with multiple implementations.

Supports CJS and ESM import.

install

npm i observavir

usage

Full docs: https://electrovir.github.io/observavir

All observables have a .value property for accessing the current value and a .listen() method for attaching callbacks to value updates.

Several different observable classes are exported from this package:

  • Observable: Bare bones basic observable. Can be listened to and its value can be updated with .setValue().
  • AsyncObservable: If given a Promise, it will update value (and listeners) when the Promise is set and then resolved or rejected so you can track and even await the Promises. Also includes a lastResolvedValue for anything that does't care about the Promise lifecycle.
  • CallbackObservable: A sub-class of AsyncObservable that accepts a callback for triggering updates of value.
  • IntervalObservable: A sub-class of CallbackObservable that will automatically update itself at a give internal rate.
2.0.5

4 months ago

2.0.4

7 months ago

2.0.3

9 months ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.0.2

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.1.2

1 year ago

1.0.0

1 year ago

0.0.0

1 year ago