DEV Community

Discussion on: Moving Material Dialog Lifecycle Into NgRx Effects

Collapse
 
chandlerbaskins profile image
Chandler Baskins

Great question! Off the top of the head I can think of a way for re usability. You could pass in the Action that you want dispatched that triggers the API call to the payload of the saveDialog action. You would do this in the the openDialog Action. Or you could pass in some key and in the effect read the key and decide what Action to dispatch there. I think I like that one better so your not passing around actual actions although it makes it harder to change in the future. Definitely something to explore and refine