mobx_utils library

Classes

LazyObservable<T>

Functions

lazyObservable<T>(dynamic fetch(dynamic sink(T newValue)), T? initialValue) LazyObservable<T>
lazyObservable creates an observable around a fetch method that will not be invoked until the observable is needed the first time. The fetch method receives a sink callback which can be used to replace the current value of the lazyObservable. It is allowed to call sink multiple times to keep the lazyObservable up to date with some external resource.