@jewel998/state-machine - v0.0.5 / CommandInvoker
Class: CommandInvoker
Command invoker with undo functionality
Implements
Table of contents
Constructors
Methods
Constructors
constructor
• new CommandInvoker(maxHistorySize?): CommandInvoker
Parameters
| Name | Type | Default value |
|---|---|---|
maxHistorySize | number | 100 |
Returns
Defined in
Methods
executeCommand
▸ executeCommand<TResult>(command): TResult
Type parameters
| Name |
|---|
TResult |
Parameters
| Name | Type |
|---|---|
command | ICommand<TResult> |
Returns
TResult
Implementation of
ICommandInvoker.executeCommand
Defined in
undo
▸ undo(): boolean
Returns
boolean
Implementation of
Defined in
canUndo
▸ canUndo(): boolean
Returns
boolean
Implementation of
Defined in
clearHistory
▸ clearHistory(): void
Returns
void
Implementation of
Defined in
getHistorySize
▸ getHistorySize(): number
Returns
number