DEV Community


Discussion on: Where to initiate data load in NgRx

timdeschryver profile image
Tim Deschryver

NgRx 7 brings us some new Effect lifecycle hooks.
One of them, OnInitEffects, might be useful to initiate a data load when an effect gets registered - see docs.

class OrdersEffects implements OnInitEffects {
  ngrxOnInitEffects(): Action {
    return { type: '[Orders Effect]: Load' };
Enter fullscreen mode Exit fullscreen mode