Package Exports
- observavir
- observavir/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (observavir) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
observavir
Flexible and simple observables with multiple implementations.
install
npm i observavirusage
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 updatevalue(and listeners) when the Promise is set and then resolved or rejected so you can track and evenawaitthe Promises. Also includes alastResolvedValuefor anything that does't care about the Promise lifecycle.CallbackObservable: A sub-class ofAsyncObservablethat accepts a callback for triggering updates ofvalue.IntervalObservable: A sub-class ofCallbackObservablethat will automatically update itself at a give internal rate.