I am currently facing an issue with ngrx/effects - specifically with a pipe being undefined. I have included a sample code snippet below that appears to be correct according to the compiler, but I am receiving an error in the browser stating that the pipe is undefined.
constructor(
private actions$: Actions,
private ethereumService: EthereumService
) { }
loadUser$ = createEffect(() =>
this.actions$.pipe(
ofType(loadAccountState),
mergeMap(() => this.ethereumService.getAccountDetails()
.pipe(
map(setAccountStateCompleted),
catchError(() => EMPTY)
)
)
)
);
In my AppModule:
StoreModule.forRoot(reducers),
EffectsModule.forRoot([AccountEffects]),
EDIT: Strange enough, even this simplified example is producing the same error
logActions$ = createEffect(() =>
this.actions$.pipe(
ofType(AccountActions.loadAccountState),
tap(action => console.log(action))
), { dispatch: false });
PS2. In addition, I am utilizing ActionReducerMap
as my main reducer file imported to Root under the name reducers
import {
createSelector,
createFeatureSelector,
ActionReducerMap,
} from '@ngrx/store';
import * as fromAccount from './account.reducer';
export interface State {
account: fromAccount.State;
}
export const reducers: ActionReducerMap<State> = {
account: fromAccount.updateAccountReducer,
};
export const selectAccountState = createFeatureSelector<fromAccount.State>('account');
//Account Selectors
export const selectCurrentUser = createSelector(
selectAccountState,
fromAccount.selectActiveAccount
);
If anyone can provide insight into what might be wrong with my code, I would greatly appreciate it. Thank you for your help