ComputedSignal<T, V> constructor
ComputedSignal<T, V> (
- BaseSignal<
T> _source, - V _transform(
- T
Implementation
ComputedSignal(this._source, this._transform)
: super(_transform(_source.value)) {
_subscription = _source.stream.listen((data) {
final newValue = _transform(data);
if (unsafeValue != newValue) {
unsafeValue = newValue;
controller.add(newValue);
}
});
}