Fork me on GitHub
Show:

AbstractCommand

Summary

AbstractCommand

Base class for all commands. Handles invalid command requests. eg: attempting to undo a command that hasn't been executed will throw a CommandHistoryError.

Proper use of CommandManager will help you avoid these types of errors.

Constructor

aeris.commands.AbstractCommand

Syntax

aeris.commands.AbstractCommand

()

Summary

Item Index

Methods

execute

Syntax

execute

() Promise final

Summary

Execute the command. wrapper around {aeris.commands.AbstractCommand}#execute_

Note that classes extending from {aeris.commands.AbstractCommand} should override the protected {aeris.commands.AbstractCommand}#execute_ method, which is called by the public {aeris.commands.AbstractCommand}#execute method.

Returns:

Promise:

A promise to complete execution of the command.

execute_

Syntax

execute_

() Promise private

Summary

Handle the business logic of executing a command. Must return a {aeris.Promise}

Returns:

Promise:

A promise to execute the command.

undo

Syntax

undo

() Promise final

Summary

Undo a command wrapper around {aeris.commands.AbstractCommand}#undo_

Note that classes extending from {aeris.commands.AbstractCommand} should override the protected {aeris.commands.AbstractCommand}#undo_ method, which is called by the public {aeris.commands.AbstractCommand}#undo method.

Returns:

Promise:

A promise to complete the undo.

Properties

requestPending_

Syntax

requestPending_

Boolean private

Summary

Is an action currently in progress / unresolved?

requestState_

Syntax

requestState_

Number

Summary

1 = Execution requested (may not be complete) 0 = Undo request -1 = No actions requested