Sprotty
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Class. Action Dispatcher

commandStack

protected commandStack: ICommandStack

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:49


diagramLocker

protected diagramLocker: IDiagramLocker

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:52


initialized

protected initialized: undefined | Promise<void>

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:56


logger

protected logger: ILogger

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:50


postponedActions

protected postponedActions: PostponedAction[] = []

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:58


requests

protected readonly requests: Map<string, Deferred<ResponseAction>>

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:59


syncer

protected syncer: AnimationFrameSyncer

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:51

Methods

dispatch()

dispatch(action): Promise<void>

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:76

Dispatch an action by querying all handlers that are registered for its kind. The returned promise is resolved when all handler results (commands or actions) have been processed.

Parameters

action

Action

Returns

Promise<void>

Implementation of

IActionDispatcher.dispatch


dispatchAll()

dispatchAll(actions): Promise<void>

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:91

Calls dispatch on every action in the given array. The returned promise is resolved when the promises of all dispatch calls have been resolved.

Parameters

actions

Action[]

Returns

Promise<void>

Implementation of

IActionDispatcher.dispatchAll


handleAction()

protected handleAction(action): Promise<void>

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:112

Parameters

action

Action

Returns

Promise<void>


handleBlocked()

protected handleBlocked(action, predicate): Promise<void>

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:163

Parameters

action

Action

predicate

(action) => boolean

Returns

Promise<void>


initialize()

initialize(): Promise<void>

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:61

Returns

Promise<void>


request()

request<Res>(action): Promise<Res>

Defined in: packages/sprotty/src/base/actions/action-dispatcher.ts:102

Dispatch a request. The returned promise is resolved when a response with matching identifier is dispatched. That response is not passed to the registered action handlers. Instead, it is the responsibility of the caller of this method to handle the response properly. For example, it can be sent to the registered handlers by passing it again to the dispatch method.

Type Parameters

Res

Res extends ResponseAction

Parameters

action

RequestAction<Res>

Returns

Promise<Res>

Implementation of

IActionDispatcher.request