watchComputed<R> method
Watch a computed value derived from this model
Implementation
Widget watchComputed<R>(
R Function() compute,
Widget Function(R value) builder,
) {
R cachedValue = compute();
return ReactiveBuilder<T>(
model: this,
builder: (_) {
final newValue = compute();
if (cachedValue != newValue) cachedValue = newValue;
return builder(cachedValue);
},
);
}