KELiON / redux-async-initial-state

Redux middleware that helps you load redux initial state asynchronously
MIT License
114 stars 12 forks source link

Help needed #2

Closed JiDai closed 8 years ago

JiDai commented 8 years ago

Hi, I tried to implement this lib in an empty project with react router, but I did not succeed is there an example anywhere ? (with or without router). Thanks

KELiON commented 8 years ago

@JiDai Hi! Can you give me more details, please, what problems did you have with setup? All you need to do is to add middleware to your store builder, as described here.

JiDai commented 8 years ago

Hi, I don't understand how the fetched data is injected in the store. I have made a little project to test the case : https://github.com/JiDai/redux-async-initial-state-example

At the line :https://github.com/JiDai/redux-async-initial-state-example/blob/master/src/main.js#L27 : how I can pass the data to the store ?

For now I have the following error : Unexpected keys "id", "name", "username", "email", "address", "phone", "website", "company" found in previous state received by the reducer. Expected to find one of the known reducer keys instead: "asyncInitialState". Unexpected keys will be ignored.

Thanks

KELiON commented 8 years ago

@JiDai I've created a pull request in your example with explanation and fix. Let me know if you need something else!