I have function which dispatched an action. I would like to display a loader before and after the action. I know that react composing the object passed to setState
Here's what you can do...
onFetchComplete callback, along with the input.Change your handleChange to -
handleChange(input) {
this.setState({ load: true }, ()=>
this.props.actions.getItemsFromThirtParty(input,
()=>this.setState({ load: false }))
);
}
This will ensure the action processor code can invoke back your state change callback even if it's not written in a promise based fashion.