How to fetch data through api in redux?

Posted by Jessica Taylor | Updated on

If you want to fetch data through api in redux? It uses redux, redux-thunk and fetch methods to fetch data through api in redux.

Actions used above:

And in your reducer you can load the posts to state;

You can access the state and actions within your component after connecting them with;

Reference:
https://stackoverflow.com/questions/39813984/how-to-fetch-data-through-api-in-redux


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers