Skip to content

Commit

Permalink
add listener
Browse files Browse the repository at this point in the history
  • Loading branch information
Alison Lai committed Jul 7, 2024
1 parent d741a33 commit 72554cd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/client/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export function initialize<T = {}>(): PluginInstance<T> {
Object.assign(subscribedInteractions, updatedInteractions);
});

on('wb:plugin:action-trigger:register', (triggerId: string) => {
registeredActionTriggers.add(triggerId);
});

function on(event: string, listener: Function) {
listeners[event] = listeners[event] || [];
listeners[event].push(listener);
Expand Down Expand Up @@ -143,11 +147,6 @@ export function initialize<T = {}>(): PluginInstance<T> {
void execPromise('wb:plugin:action-trigger:invoke', id);
},
configureEditorPanel(options) {
registeredActionTriggers.clear();
for (const option of options) {
if (option.type !== 'action-trigger') continue;
registeredActionTriggers.add(option.name);
}
void execPromise('wb:plugin:config:inspector', options);
},
setLoadingState(loadingState) {
Expand Down

0 comments on commit 72554cd

Please sign in to comment.