I am trying to retrieve local storage data via NgRx effect. PATIENT_FETCH action is dispatched to execute an effect. But having an infinite call upon calling the dispatch method in ngOnInit method.
Here is the stackblitz demo. If you uncomment line 24 in patient.component.ts of given link then reducer is called for infinite times. I might be missing something in NgRx implementation.
The problem is the Effect.
The above keeps dispatching the
PATIENT_FETCHaction, and picks it up again - resulting in an infite loop. From looking at the code you probably want to return thePATIENT_FETCH_SUCCESSaction. Therefore, you must replace thetapoperator with themapoperator.