Below is the code snippet I am working with:
export const googleTagManagerInternalActionsEpic: Epic<RootAction, RootAction, RootState, Services> = (action$, state$) => {
return action$.pipe(
mergeMap(action => merge(
of(action).pipe(
filter(isActionOf(triggerGTMEvent)),
tap(({ payload: eventName }) => {
console.log(eventName);
}),
mergeMap(() => loadQuestion()),
map(questionImport => questionImport.default),
tap((question) => {
console.log(question);
debugger;
}),
ignoreElements(),
),
)),
);
}
I am trying to access the same value of eventName
in the second console.log(...)
as I have in the first one. The issue I'm facing here is that the mergeMap
I have in between is interfering with the payload propagation. I only introduced that mergeMap
to gather information from the loadQuestion()
call.
Is there a way for me to retrieve both values successfully?
Thank you!