erikras / erikras/react-redux-universal-hot-example

how to an API call on the response of first API

Open
#899 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

hi All i have a http call in the widgetReducer its like
export function load() {
return {
types: [LOAD, LOAD_SUCCESS, LOAD_FAIL],
promise: (client) => client.get('/autosuggest.php?case=popular_suggestion&city=Bangalore')
};
}
return {
types: [LOAD, LOAD_SUCCESS, LOAD_FAIL],
promise: (client) => client.get('/autosuggest.php?case=popular_suggestion&city=Bangalore')
};
}
So what i want is on the response from this above API i need to call another API. SO can any one let me know hot to get it.

This load function is being called in the widget of the container as

`function fetchData(getState, dispatch) {
if (!isLoaded(getState())) {
return dispatch(loadWidgets());
}
}

@connectData(fetchData, null)
@connect(
state => ({
widgets: state.widgets,
editing: state.widgets.editing,
}),
{...widgetActions })`
so loadWidgets is being called which calls the load., and as i get the response of loadWidget i need to call another API. after the first call is made.
Please let me know how to implement

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.