-
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 #55 from codex-team/fix/app-state-types
fix(build): pull fixes to main
- Loading branch information
Showing
6 changed files
with
46 additions
and
11 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,6 +1,24 @@ | ||
import type { AUTH_COMPLETED_EVENT_NAME, AuthCompletedEvent } from './events/AuthCompleted'; | ||
|
||
/** | ||
* Event Bus provides a loosely coupled communication way between Domain and some other layers | ||
* | ||
* Extends native event emitter called EventTarget | ||
*/ | ||
export default class EventBus extends EventTarget {}; | ||
|
||
/** | ||
* All cross domain events map | ||
*/ | ||
export type CrossDomainEventMap = { | ||
[AUTH_COMPLETED_EVENT_NAME]: AuthCompletedEvent; | ||
}; | ||
|
||
/** | ||
* Augment EventTarget's addEventListener method to accept CustomEvent | ||
*/ | ||
declare global { | ||
interface EventTarget { | ||
addEventListener<T extends keyof CrossDomainEventMap>(type: T, listener: (event: CrossDomainEventMap[T]) => void): void; | ||
} | ||
} |
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