DEV Community

Discussion on: 3 Radically Small Things You Can Change In Your NgRx Effects Code 🌞

Collapse
 
davidshortman profile image
David

I would argue that the notification and route navigation are commands, and should be performed thru an injected service. As to the particular order, that would be easy as you could do SuccessAction -> showNotification$ -> NotificationDisplayed -> redirectToNewPage$.

Of course, the user might miss that notification if you're immediately redirecting, so hopefully there's a delay in there (which would be easier to do with distinct effects as opposed to them all immediately emitting at once from a single effect).