(store: Store<IReduxState>)
| 95 | } |
| 96 | |
| 97 | private getCommandManager(store: Store<IReduxState>): CollaCommandManager { |
| 98 | if (this.commandManagers.has(store)) { |
| 99 | return this.commandManagers.get(store)!; |
| 100 | } |
| 101 | const commandManager = new CollaCommandManager( |
| 102 | { |
| 103 | handleCommandExecuted: (resourceOpCollections: IResourceOpsCollect[]) => { |
| 104 | // FIXME should await |
| 105 | void this.fireEvent({ |
| 106 | type: ResourceEventType.CommandExecuted, |
| 107 | execResult: CommandExecutionResultType.Success, |
| 108 | resourceOpCollections, |
| 109 | }); |
| 110 | }, |
| 111 | handleCommandExecuteError: (error, errorType) => { |
| 112 | // FIXME should await |
| 113 | void this.fireEvent({ |
| 114 | type: ResourceEventType.CommandExecuted, |
| 115 | execResult: CommandExecutionResultType.Error, |
| 116 | error, |
| 117 | errorType, |
| 118 | }); |
| 119 | }, |
| 120 | }, |
| 121 | store, |
| 122 | ); |
| 123 | this.commandManagers.set(store, commandManager); |
| 124 | return commandManager; |
| 125 | } |
| 126 | |
| 127 | private _eventHandlers: Map<ResourceEventType, Set<IResourceEventHandler>> = new Map(); |
| 128 |
no test coverage detected