run static method
Implementation
static void run(
VoidCallback action, {
String? name,
ErrorCallback? onError,
}) {
// Optimize action name generation
/// Stores the =.
final actionName = name ?? _getCachedActionName(_actionStack.length + 1);
/// Stores the =.
final wasInAction = _isInAction;
/// if method.
if (!wasInAction) {
_isInAction = true;
}
_actionStack.add(actionName);
try {
MinixErrorHandler.safeExecute(
action,
onError: onError ?? _defaultErrorHandler,
context: 'Action: $actionName',
);
} finally {
_actionStack.removeLast();
// Only flush when exiting outermost action
/// if method.
if (!wasInAction) {
_isInAction = false;
_flushQueueOptimized();
}
}
}