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

How to detect when a dispatched action completes ? #543

Open
2 tasks done
melkishengue opened this issue Oct 1, 2018 · 1 comment
Open
2 tasks done

How to detect when a dispatched action completes ? #543

melkishengue opened this issue Oct 1, 2018 · 1 comment

Comments

@melkishengue
Copy link

melkishengue commented Oct 1, 2018

This is a...

  • usage question

What toolchain are you using for transpilation/bundling?

  • @angular/cli

Environment

NodeJS Version: v8.11.2
Typescript Version:
Angular Version: 6
@angular-redux/store version: 9.0.0
@angular/cli version: (if applicable) 6.0.8
OS: OSX

Additional Notes:

I would just like to know if it is possible to detect when an action completes, when using angular-redux. May be something like returning a promise... If yes, a small example will help a lot. Thanks in advance.

@gregkopp
Copy link

gregkopp commented Jan 9, 2019

Whatever is acting on your action (in an Epic, I would assume) should dispatch another action indicating such.

ie.:
Dispatch: DATA_REQUESTED
Epic: Calls API and gets data
Dispatch: DATA_RECEIVED

Your DAT_RECEIVED action can then be handled in your reducer. I have used this method in the past for busy indicators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants