Is Redux frontend or backend

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

MatruskanMatruskan

16611 silver badge77 bronze badges