store icon indicating copy to clipboard operation
store copied to clipboard

How to detect when a dispatched action completes ?

Open melkishengue opened this issue 6 years ago • 1 comments

This is a...

  • [x] usage question

What toolchain are you using for transpilation/bundling?

  • [x] @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.

melkishengue avatar Oct 01 '18 00:10 melkishengue

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.

gregkopp avatar Jan 09 '19 19:01 gregkopp