Is there a way to reuse reducers/effects? #502
Replies: 2 comments
-
While not quite reusable, you can get this functionality if you use an interface on the Action for Effects. Multiple actions that use the interfaces will be processed by the same effect that is listening to the Interface |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can only have one |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I have a reducer or effect that uses the typeOf in the annotation, is there a way to stack annotations so that the single effect or reducer would be triggered?
This is a useful feature in Ngrx with Typescript, that I'm not sure would be possible in C#.
Ideally, there might be a way to map a set of actions that both implement an interface so that the data inside the actions could be piped through the effect or reducer the same way like below.
I've found this incredibly helpful to prevent duplicate logic and code in my reducers and effects in Ngrx, but I get that this might not be possible for c#, thought I'd ask anyway
Beta Was this translation helpful? Give feedback.
All reactions