forceReset method
TState
forceReset(
- TState state
Forcibly resets the logic block to the given state, exiting and
detaching the current state.
Throws a StateError if called while the logic block is processing inputs, or if the logic block is not started or has been disposed.
Implementation
TState forceReset(TState state) {
_throwIfDisposed('forceReset');
if (!isStarted) {
throw StateError(
'Cannot force reset a logic block that has not been started.',
);
}
if (isProcessing) {
throw StateError(
'Cannot force reset a logic block while it is processing inputs. '
"Do not call ForceReset() from inside a logic block's own state.",
);
}
_changeState(state);
return _initialize();
}