cancel last command if exists and if
Source
void cancel() { if (history.isEmpty) return; history.removeLast(); var prevState = apply(); var cmd = new CancelCommand(prevState); update(cmd); }
cancel last command if exists and if
void cancel() { if (history.isEmpty) return; history.removeLast(); var prevState = apply(); var cmd = new CancelCommand(prevState); update(cmd); }