Created
January 28, 2019 22:29
-
-
Save jtcrowson/f33f649379c6a1e9203c13c0d8b8eedc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// -- error.actions.ts -- | |
export class LaunchErrorModal implements Action { | |
readonly type = ErrorActions.LaunchErrorModal; | |
} | |
export class MarkErrorModalAsOpen implements Action { | |
readonly type = ErrorActions.MarkErrorModalAsOpen; | |
} | |
export class CloseErrorModal implements Action { | |
readonly type = ErrorActions.CloseErrorModal; | |
} | |
export class UnmarkErrorModalAsOpen implements Action { | |
readonly type = ErrorActions.UnmarkErrorModalAsOpen; | |
} | |
// -- error.effects.ts -- | |
@Effect() | |
launchErrorModal$: Observable<Action> = this.actions$.pipe( | |
ofType<LaunchErrorModal>(ErrorActions.LaunchErrorModal), | |
withLatestFrom(this.store.pipe(select(fromError.getIsErrorModalOpen))), | |
filter | |
tap(() => this.dialog.open(ErrorModalComponent)) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment