-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
17 changed files
with
905 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"branches": 100, | ||
"lines": 100, | ||
"functions": 100, | ||
"statements": 100 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { NotificationType } from "./NotificationType"; | ||
|
||
export type EventData<U> = { | ||
/** | ||
* ie: State on Enter/Leave or Transition | ||
*/ | ||
notificationType: NotificationType | ||
/** | ||
* For the state or transition the value | ||
*/ | ||
value: U | ||
} |
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,10 @@ | ||
/** | ||
* Right now only allows to notify that future observers should be skipped, but we likely want to allow an observer to block some events (ie: Transition) | ||
*/ | ||
export type EventState = { | ||
/** | ||
* An Observer can set this property to true to prevent subsequent observers of being notified. | ||
* TODO: consider a cancellation with same functionality | ||
*/ | ||
skipNextObservers: boolean; | ||
} |
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,29 @@ | ||
export enum NotificationType { | ||
/** | ||
* Should not be used | ||
*/ | ||
None = 0, | ||
/** | ||
* When a state is entered | ||
* NOTE: 0x001 | ||
*/ | ||
StateEnter = 1, | ||
/** | ||
* When a state is left | ||
* NOTE: 0x010 | ||
*/ | ||
// tslint:disable-next-line:no-bitwise | ||
StateLeave = 1 << 1, | ||
/** | ||
* When a transition occurs | ||
* NOTE: 0x0100 | ||
*/ | ||
// tslint:disable-next-line:no-bitwise | ||
Transition = 1 << 2, | ||
/** | ||
* Includes state enter/leave/transition. You need to use the event to determine what has occured. | ||
* NOTE: 0x0111 | ||
*/ | ||
// tslint:disable-next-line:no-bitwise | ||
All = ~(~0 << 3) | ||
} |
Oops, something went wrong.