Interview of @matheusml about #redux zero, a light state management solution for #reactjs

  • Redux Zero is a library which offers a simple way to handle state in modern applications.
  • With Redux Zero your component can focus 100% on the UI and just call the actions to update the state: – – Last but not least, plug the whole thing in your index file: – – Redux is great, but in some cases, it’s way too much.
  • With Redux Zero you just have a store and some actions.
  • One of our developers here at Concrete, Miguel Albernaz, was using this gist as a state management solution instead of Redux.
  • Redux Zero is one of the lightest state management solutions I’ve seen so far.

Although using Redux is straight-forward once you understand the approach and its nuances, after a while it gets repetitive. It’s easy to end up with a lot of “boilerplate” code that wires all the logic together. For this reason, multiple solutions addressing the issue have appeared.

Although using Redux is straight-forward once you understand the approach and its nuances, after a while it gets repetitive. It’s easy to end up with a lot of “boilerplate” code that wires all the logic together. For this reason, multiple solutions addressing the issue have appeared.

In this interview, we’ll learn about Redux Zero by Matheus Lima.

See also the Kea interview for another approach and the original Redux interview to learn more about the approach from its creator.

I am Matheus Lima, a JavaScript lead developer at Concrete Solutions.

Redux Zero is a library which offers a simple way to handle state in modern applications. It’s lightweight, easy to learn and already works with React, React Native, Preact and Svelte. We have plans to add Angular and Vue.js bindings as well.

It’s simple.

First, create a store. The application state will live here:

import { createStore } from ‘redux-zero’ ; const initialState = { count: 1 } ; const store = createStore (initialState) ; export default store;

Then, create some actions to change the state of your store:

const actions = store = > ( { increment: state = > ( { count: state.count + 1 } ) , decrement: state = > ( { count: state.count – 1 } ) , } ) ;

Since the actions are bound to the store, they are just pure…

Redux Zero