1

In my application, inside the componentDidMount(), I want to dispatch an action, which has 2 API calls. In angular, with observables, we can use forkJoin() to achieve this. In react / react-native, do we have a similar method to forkJoin()? If now, what will be a good practice to call 2 API endpoints?

2

1 Answer 1

1

Also using Promise chaining would be useful.

someApiCall().then(function (bun) {
    return addSausage(bun)
}).then(function (bunWithSausage) {
    return addSauce(bunWithSausage)
}).then(function (hotdog) {
    return hotdog
})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.