Skip to content

Commit

Permalink
fix(embedding-sdk): use callback for getDataMasks
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedHalat committed Dec 9, 2024
1 parent 2f19b3d commit 438c989
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions superset-embedded-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export type EmbeddedDashboard = {
unmount: () => void;
getDashboardPermalink: (anchor: string) => Promise<string>;
getActiveTabs: () => Promise<string[]>;
getDataMasks: () => Promise<any[]>;
getDataMasks: (callbackFn: (dataMasks: any[]) => void) => void;
};

/**
Expand Down Expand Up @@ -199,7 +199,11 @@ export async function embedDashboard({
const getDashboardPermalink = (anchor: string) =>
ourPort.get<string>('getDashboardPermalink', { anchor });
const getActiveTabs = () => ourPort.get<string[]>('getActiveTabs');
const getDataMasks = () => ourPort.get<any[]>('getDataMasks');
const getDataMasks = (callbackFn: (dataMasks: any[]) => void) => {
ourPort.start();
ourPort.defineMethod("getDataMasks", callbackFn);
};


return {
getScrollSize,
Expand Down

0 comments on commit 438c989

Please sign in to comment.