SignalSelector<T, S> constructor

SignalSelector<T, S>(
  1. Signal<T> source,
  2. S selector(
    1. T value
    ), {
  3. String? debugLabel,
})

Implementation

SignalSelector(
  this.source,
  this.selector, {
  String? debugLabel,
}) : super(selector(source.val), debugLabel: debugLabel) {
  _subscription = source.stream.listen((value) {
    final selected = selector(value);
    if (val != selected) {
      emit(selected);
    }
  });
}