|
@ -22,7 +22,7 @@ function nextIpcId() { |
|
|
return `webview:${ipcSequence}`; |
|
|
return `webview:${ipcSequence}`; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export abstract class App<State extends object> { |
|
|
|
|
|
|
|
|
export abstract class App<State extends object = any> { |
|
|
private readonly _api: VsCodeApi; |
|
|
private readonly _api: VsCodeApi; |
|
|
protected state: State; |
|
|
protected state: State; |
|
|
|
|
|
|
|
@ -78,6 +78,8 @@ export abstract class App { |
|
|
|
|
|
|
|
|
protected setState(state: State) { |
|
|
protected setState(state: State) { |
|
|
this.state = state; |
|
|
this.state = state; |
|
|
|
|
|
if (state == null) return; |
|
|
|
|
|
|
|
|
this._api.setState(state); |
|
|
this._api.setState(state); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|