I need to display a list of all users in my application that are matching a certain set of filters. I am getting the filters via an http get call (“getClass”). When I get a response with the set of filter I have to make another http call to get the users that are matching those filters.
So I made an action called – GetClass and also made GetClassSuccess for the effect.
I also have an action called – GetDirectory and a matching GetDirectorySuccess that the matching effect will dispatch.
Now here is my question:
if I write a sequence of commands:
this.store.dispatch(new directoryActions.GetClass()); this.store.dispatch(new directoryActions.GetDirectory());
I cant guarantee that myClass will end by the time that GetDirectory will start. Infact it will never will.
So what is the best way to make sure and action has finished before starting another action. Should I make another effect that listens to the “GetClassSuccess” and then dispatched “GetDirectory” action?
Source: New feed
Source Url Starting an Action after another action’s effect is finished dispatching its success action