- Graphically, this is the schema of a Redux app: – – Basically, Redux does the following: – – An OTP GenServer does the following: – – In short, we can use the same mental model for the client and server side.
- We can dispatch events to Elixir, compute a new version state server side, propagate this state to redux, and our views will get updated automatically.
- We have just implemented the thick red arrows: – – We will update the store with the state that comes from the server in two different situations.
- With this, we have connected the server state with Redux state.
- But, if you want to have state shared between different users, or we want to have pieces of the state in the server for other reasons, such as enforcing validation rules, we can use the same mental mode with Elixir GenServers.
Digital solutions partner. High quality work with Symfony, React and Elixir.
Continue reading “The joy of React+Redux with Elixir/OTP”