Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private function with a callback to another function dispatching an action is not considered in the chain #42

Open
ammarnajjar opened this issue Dec 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@ammarnajjar
Copy link
Owner

minimal example for the issue:

@Injectable()
export class LoadingStateEffects {
  private do = (callback: () => Action): OperatorFunction<Action, Action> => map(() => callback());

  effect1$ = createEffect(() =>
    this.actions$.pipe(ofType(action1), this.do(dispatchAction2))
  );

  effect1$ = createEffect(() =>
    this.actions$.pipe(ofType(action3), this.do(dispatchAction4))
  );
}

function dispatchAction2() {
  return action2()
}

function dispatchAction4() {
  return action4()
}

expected graph:

action1 -> action2
action3 -> action4
@ammarnajjar ammarnajjar added the bug Something isn't working label Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant