where method

void where(
  1. bool condition(
    1. T value
    ),
  2. void callback(
    1. T value
    )
)

Only call callback when value meets condition

Implementation

void where(
    bool Function(T value) condition, void Function(T value) callback) {
  void listener() {
    if (condition(value)) {
      callback(value);
    }
  }

  addListener(listener);
}