Skip to content

How to detect when a dispatched action completes ? #543

Open

Description

@melkishengue

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.

Activity

  1. gregkopp commented on Jan 9, 2019

    @gregkopp

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions