Skip to content

Commit

Permalink
feat: 🎸 connect dynamic action manager to embeddable life-cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Apr 7, 2020
1 parent 4aaf17e commit 5fea25d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions x-pack/plugins/embeddable_enhanced/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,30 @@ export class EmbeddableEnhancedPlugin
uiActions: this.uiActions!,
});

dynamicActions.start().catch(error => {
/* eslint-disable */
console.log('Failed to start embeddable dynamic actions', embeddable);
console.error(error);
/* eslint-enable */
});

const stop = () => {
dynamicActions.stop().catch(error => {
/* eslint-disable */
console.log('Failed to stop embeddable dynamic actions', embeddable);
console.error(error);
/* eslint-enable */
});
};

embeddable.getInput$().subscribe({
next: () => {
storage.reload$.next();
},
error: stop,
complete: stop,
});

enhancedEmbeddable.enhancements = {
...enhancedEmbeddable.enhancements,
dynamicActions,
Expand Down

0 comments on commit 5fea25d

Please sign in to comment.