-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
avner
committed
Jun 15, 2023
1 parent
69516d7
commit b5ba53c
Showing
9 changed files
with
59 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
import { Event, EventEmitter } from "vscode"; | ||
import { Disposable, Event, EventEmitter } from "vscode"; | ||
|
||
export enum InstallationState { | ||
Undefined, | ||
ExistingInstallation, | ||
NewInstallation, | ||
} | ||
|
||
export class InstallationStateEmitter { | ||
private static emitter = new EventEmitter<InstallationState>(); | ||
export class InstallationStateEmitter implements Disposable { | ||
private emitter = new EventEmitter<InstallationState>(); | ||
|
||
private static internalState = InstallationState.Undefined; | ||
private internalState = InstallationState.Undefined; | ||
|
||
static get state(): InstallationState { | ||
return InstallationStateEmitter.internalState; | ||
get state(): InstallationState { | ||
return this.internalState; | ||
} | ||
|
||
static fire(state: InstallationState) { | ||
InstallationStateEmitter.internalState = state; | ||
InstallationStateEmitter.emitter.fire(state); | ||
fire(state: InstallationState) { | ||
this.internalState = state; | ||
this.emitter.fire(state); | ||
} | ||
|
||
static get event(): Event<InstallationState> { | ||
return InstallationStateEmitter.emitter.event; | ||
get event(): Event<InstallationState> { | ||
return this.emitter.event; | ||
} | ||
|
||
dispose() { | ||
this.emitter.dispose(); | ||
} | ||
} | ||
|
||
export const installationState = new InstallationStateEmitter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters