Last active
April 3, 2019 15:05
-
-
Save alex-okrushko/94a01594d92c37937985aaaedaa75271 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
export class MyEffects { | |
constructor(private readonly actions$: Actions<ActionsUnion>) {} | |
@Effect | |
login$ = this.actions$.pipe( | |
// ensures type safety only when ActionsUnion is provided | |
ofType(login.type), | |
... | |
) | |
@Effect | |
login2$ = this.actions$.pipe( | |
// explicitly provided generic works as well | |
ofType<ReturnType<typeof login>>(login.type), | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment