DEV Community


Discussion on: NGRX | Use effects and router-store to isolate route related side 🧙🏼‍♂️ effects

timdeschryver profile image
Tim Deschryver

Woo-hoo effects!
This can be made a little bit easier imho by just using the id selector as the source of the effect

 setCurrentCourse$ = createEffect(() =>'id') as any)))
     map((id: string) => setIds({ id })), // dispatch a new action to set the selected id
   ), { dispatch: true });
adamgenshaft profile image
Adam Genshaft Author

Effects are magical, are they :)

Thanks, I agree with you so I updated the example 🚀