0

Github link to my sample program.

in file app.component.ts created a session expiry action which will be triggered once timeout happens

 timerExpiration : setTimeout(() => {
          this.store.dispatch(SessionActions.expirationTimerElapsed())
        }, 2000) as unknown as number  ,

once above action

in effect of SessionActions.expirationTimerElapsed is completed,

SessionActions.terminateSession action should be triggered

session.effects.ts

expiredTimer = createEffect(()=> 
    this.actions.pipe(
      ofType(SessionActions.expirationTimerElapsed),
      map(()=> SessionActions.terminateSession({reason :'TimeOut'}))
    )
  );

but SessionActions.terminateSession is not called.

Any idea what I'm doing wrong?

Kevin B
  • 94,570
  • 16
  • 163
  • 180
theRoot
  • 571
  • 10
  • 33

1 Answers1

1

The effect needs to be registered in a module. For more info see the docs: https://ngrx.io/guide/effects#registering-root-effects

timdeschryver
  • 14,415
  • 1
  • 19
  • 32