on method

void on(
  1. List<Object?> rxValues(),
  2. void reducer(), {
  3. bool filter()?,
})

reducer register:

on(() => [state], _incrementReducer);

Implementation

void on(
  List<Object?> Function() rxValues,
  void Function() reducer, {
  bool Function()? filter,
}) {
  final rxDisposer = rxObserver<void>(
    () {
      for (final value in rxValues()) {
        if (value is RxNotifier) {
          value.value;
        } else {
          value;
        }
      }
    },
    effect: (_) => reducer(),
    filter: filter,
  );
  _rxDisposers.add(rxDisposer);
}