runIfNotPending method

bool runIfNotPending(
  1. AsyncAction action
)

Schedules action only if no action is already pending.

Returns true if the action was scheduled, false if skipped.

Implementation

bool runIfNotPending(AsyncAction action) {
  if (_lastAction != null) return false;
  run(action);
  return true;
}