disposeObservations method
Synchronizes this widget's state to a SingleValue
observable. This assumes that the
value contained within observable
is already being read by the widget builder, and this
just ensures that setState
is called each time observable
is mutated.
Implementation
// void sync<T>(SingleValue<T> observable, {int delay}) {
// Future.microtask(() => reactions.add(mobx.reaction(
// (_) => observable.value,
// (_) => onObserve,
// delay: delay,
// )));
// }
Future disposeObservations() async {
_isDisposing = true;
for (var dispose in [...disposers]) {
await dispose();
}
disposers.clear();
for (var subscription in [...subscriptions]) {
await subscription.cancel();
}
subscriptions.clear();
}