loading...

re: NGRX | Use effects and router-store to isolate route related side 🧙🏼‍♂️ effects VIEW POST

FULL DISCUSSION
 

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(() => this.store.pipe(select(selectRouteParam('id') as any)))
  .pipe(
     map((id: string) => setIds({ id })), // dispatch a new action to set the selected id
   ), { dispatch: true });
 

Effects are magical, are they :)

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

code of conduct - report abuse