Use json server to fake api calls and shorten to manage state, I used this in one of my projects. It is quite simple and requires very little template code. Redux updates the global store through actions, and components can subscribe to save changes.
See documentation here
https://github.com/typicode/json-server
http://redux.js.org/
An example from my application- You can create a fake store by creating db.json , and then you can use either the default routes provided by json-sever, or create your own.
It could be your db.json
{ "questions": [ { "id": 2, "question": "A train running at the speed of 60 km/hr crosses a pole in 9 seconds. What is the length of the train?", "options": [ "120 metres", "180 metres", "324 metres", "150 metres" ], "answer": 4 }, { "id": 3, "question": "The length of the bridge, which a train 130 metres long and travelling at 45 km/hr can cross in 30 seconds, is", "options": [ "200 m", "225 m", "245 m", "250 m" ], "answer": 3 } ] }
run this api layout by running this json-server --watch db.json in your db.json file folder.
Then use http: // localhost: 3000 / questions
Comment if you want to get more detailed information about any of the above materials. I can provide you with sample code since I implemented this full stream.
source share