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

Function interceptor

packages/widget-sdk/src/message/utils.ts:37–49  ·  view source on GitHub ↗
(callback?: (data: any, messageId?: string) => void)

Source from the content-addressed store, hash-verified

35 * @param callback
36 */
37export const interceptor = (callback?: (data: any, messageId?: string) => void) => {
38 return (res: IResponse<any>, messageId?: string) => {
39 if (!res.success) {
40 console.error(res.message);
41 return;
42 }
43 callback?.(res.data, messageId);
44 messageId && messageMap.pop(messageId, {
45 success: true,
46 data: res.data
47 });
48 };
49};

Callers 13

connectWidgetMethod · 0.90
onInitWidgetMethod · 0.90
onSyncWidgetConfigMethod · 0.90
onRefreshWidgetMethod · 0.90
onSyncActionMethod · 0.90
onMethod · 0.90
onSyncActionMethod · 0.90
onRefreshWidgetMethod · 0.90
onFetchDatasheetMethod · 0.90
syncCmdMethod · 0.90

Calls 3

errorMethod · 0.65
callbackFunction · 0.50
popMethod · 0.45

Tested by

no test coverage detected