Definitely persist the actions!
This is only a counterexample, adding to Dan Fitch's comment in the previous answer.
If you persisted your state, you wouldn't ever be able to modify your state without altering columns and tables in your database. The state shows you only how things are now, you can't rebuild a previous state, and you won't know which facts had happened.
Example: persist an action to a server
Your already is a "type" and a "payload", and that's probably all you need in an Event-Driven/Event-Sourcing architecture.
You can call your back-end and send the actions inside your (see Dan Fox's answer).
Another alternative is to use a middleware to filter what actions you need to persist, and send them to your backend, and, optionally, dispatch new events to your store.
(You can also use a middleware to send current state to the backed. Call .)
Your app already knows how to transform actions into state with , so you can also fetch actions from your backend too.
answered Jul 16 '19 at 14:30
16611 silver badge77 bronze badges
- Do snakes bite or sting
- How accurate is VICE
- What is your favourite way to shower
- Is it wrong to want it all
- How can I understand more when reading?no_redirect=1
- How do I become an IPTV reseller
- How do I buy paintings in Dubai
- How do I stop pivoting
- What is Leeds answer to Canary Wharf
- Do you like Axl Rose
- What does Mexico manufacturer
- Does Netfilx use token based authentication
- Can public defenders be trusted
- Which came first secrets or lying
- What does it diligence mean
- What is IEEE
- How does USA deal with birth tourism
- Is it normal to be apolitical
- What are the volunteering options in Ahmedabad
- Can India build Iron Man