Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Last active October 14, 2020 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmotta/3994ef8cf5f925b23e8aeb7ea5f6dbc1 to your computer and use it in GitHub Desktop.
Save ljmotta/3994ef8cf5f925b23e8aeb7ea5f6dbc1 to your computer and use it in GitHub Desktop.
TodoListWebview subscriptions
public open(pageId: string, opts: { onClose: () => void }) {
// ...
this.context.subscriptions.push(
webviewPanel.webview.onDidReceiveMessage(
(msg) => envelopeServer.receive(msg, this.api),
webviewPanel.webview,
this.context.subscriptions
)
);
webviewPanel.onDidDispose(
() => {
envelopeServer.stopInitPolling();
opts.onClose();
},
webviewPanel.webview,
this.context.subscriptions
);
envelopeServer.startInitPolling();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment