Files
packages.dart/packages/undo/lib/src/change.dart
2026-01-15 17:28:55 -08:00

24 lines
344 B
Dart

class Change<T> {
Change(
this._oldValue,
this._execute(),
this._undo(T oldValue), {
this.description = '',
});
final String description;
final void Function() _execute;
final T _oldValue;
final void Function(T oldValue) _undo;
void execute() {
_execute();
}
void undo() {
_undo(_oldValue);
}
}