-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type safety in effects, feedback #965
Comments
See #860 |
@michaelgeorgeattard your stuff is so complex i think :) look at the ngrx example //auth.type.ts
// auth.action.ts
// auth.effect.ts
// auth.reducer.ts
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Our actions are declared as follows:
Each action class has a union of actions as follows:
ActionsUnion
type is declared as follows:This provides us with type safety in reducers without a lot of boilerplate code.
For effects we do the following for type safety:
ActionSignature
type is declared as follows:We have a generic
Action
type, and anActionWithPayload
type as follows:These types depend on Typescript 2.8+.
Can you give us feedback on our type safety solution?
Do you think it would be possible to move some of the type magic to
ngrx
?The text was updated successfully, but these errors were encountered: