Skip to content

Commit d9daf6b

Browse files
committed
Adds state provider support to GlApp
1 parent 8ec0b2a commit d9daf6b

File tree

1 file changed

+4
-0
lines changed
  • src/webviews/apps/shared

1 file changed

+4
-0
lines changed

src/webviews/apps/shared/app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ export abstract class GlApp<
3838
private _focused?: boolean;
3939
private _inputFocused?: boolean;
4040
private _sendWebviewFocusChangedCommandDebounced!: Deferrable<(params: WebviewFocusChangedParams) => void>;
41+
private _stateProvider!: Disposable;
42+
43+
protected abstract createStateProvider(state: State, ipc: HostIpc): Disposable;
4144

4245
override connectedCallback() {
4346
super.connectedCallback();
@@ -53,6 +56,7 @@ export abstract class GlApp<
5356

5457
this._ipc = new HostIpc(this.name);
5558
this.disposables.push(
59+
(this._stateProvider = this.createStateProvider(this.state, this._ipc)),
5660
this._ipc.onReceiveMessage(msg => {
5761
switch (true) {
5862
case DidChangeWebviewFocusNotification.is(msg):

0 commit comments

Comments
 (0)