2

Assume your app doesn't need to work offline. Also assume that you want to render some fresh data from server -> Redux store for that data is invalidated every time it's rendered.

Does it make sense to store such data into Redux store? Creating reducers for data that is invalidated anyway seems like waste of time.

Deduplicator
9,2395 gold badges33 silver badges53 bronze badges
asked Apr 6, 2016 at 13:52

1 Answer 1

2

Yes, you should have getters for soon-to-be-invalidated data.

The Flux approach (Redux included) generally encourages synchronous getters for the application's current state. It doesn't have to be "correct" from the server's POV, but it needs to be complete and usable. Stores and reducers are generally not responsible for syncing up with the back end; how that is handled exactly varies between implementations.

If an update comes in from the server, an action will get fired to the stores/reducers, and the views will re-render this data.

answered Apr 6, 2016 at 15:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.