nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32

Home Page:https://nodemcu.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redux state container for ESP8226, ESP32

shubham-sri opened this issue · comments

Missing Feature: NodeRedux - state container

Redux is a predictable state container for JavaScript apps. So we can use the same concept to manage the state of ESP devices. It helps you write applications that behave consistently.

Justification

The whole global state of your app is stored in an object tree inside a single store. The only way to change the state tree is to create an action, an object describing what happened, and dispatch it to the store. To specify how the state gets updated in response to an action, you write pure reducer unctions that calculate a new state based on the old state and the action.

Workarounds

I have translated the logic of Redux in JS to Lua. You can check here

Closing; further discussion can take place on the PR.