Search code examples
reactjsreactjs-flux

How do you call a rest service in react.js using the Fluxes framework


This a new question.

I am new React.js and to the Flux framework. My project are trying to quickly put together a React application to show a couple of tables of data, where the data will come from two java based rest services.

Reviewing the examples on Internet I am left more baffled than I was at the beginning. All I am looking for is an example or if someone could descride to me how you can call a rest service from react.js and pass the Json response to the store, for example Usersearchresultsstore? One table will have no results but the other table will have data when the application is loaded.

If anyone can please show me an example, I will be grateful.


Solution

  • flux flow: action => dispatcher => store => view

    Ajax requests should be in action creators. Even you have multiple actions.