-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #409 from iljapostnovs/development
Development
- Loading branch information
Showing
5 changed files
with
81 additions
and
31 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { TextDocument } from "vscode"; | ||
|
||
export default class EventBus { | ||
private static readonly _subscriptions: Record<string, ((document: TextDocument) => void)[]> = { | ||
CodeUpdated: [] | ||
}; | ||
static subscribeCodeUpdated(handler: (document: TextDocument) => void) { | ||
this._subscriptions.CodeUpdated.push(handler); | ||
} | ||
|
||
static fireCodeUpdated(document: TextDocument) { | ||
this._subscriptions.CodeUpdated.forEach(handler => handler(document)); | ||
} | ||
} |
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