MCPcopy Create free account
hub / github.com/apitable/apitable / getCommandManager

Method getCommandManager

packages/core/src/databus/logic/database.ts:97–125  ·  view source on GitHub ↗
(store: Store<IReduxState>)

Source from the content-addressed store, hash-verified

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

Callers 2

getDatasheetMethod · 0.95
getDashboardMethod · 0.95

Calls 4

fireEventMethod · 0.95
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected