run method

bool run(
  1. RxAction action, {
  2. bool notify = true,
})

Run action with registration and notifications disabled. Will notify after action is completed if notify is true and the child implementation decides a notification should be sent.

Returns true if a notification was attempted during action

Implementation

bool run(RxAction action, {bool notify = true}) {
  var notified = false;
  runRxZoned(
    () {
      final result = action() as dynamic;
      if (result is Future) {
        throw RxRunActionWasAsync();
      }
    },
    notifier: (id) => notified = true,
  );
  return notified;
}