Currently, I am facing a challenge in accessing the stream variable within a custom operator. The effect code snippet is structured like this:
@Effect()
v$ = this.actions$.pipe(
ofType(ActionTypes.Action),
map((action: ActionType) => action.payload),
customOperator(
new ActionCall(<I need to use the stream variable here>),
... // some other things not important in this context
),
);
The customOperator implementation is as follows:
export function customOperator<T>(<function parameters>): OperatorFunction<T, T> {
return function (source$: Observable<T>): Observable<T> {
... // Although the stream variable is accessible at this point, it does not serve my purpose here
};
}
I attempted to set the stream variable to a class variable within the tap
operator, but unfortunately, it resulted in undefined. This dilemma has been quite perplexing for me.