Which IMO is simpler to understand as a newbie than Redux. Maybe because it had the luxury of coming after Redux/similar projects and underpinning a simpler parent framework.
Which IMO is simpler to understand as a newbie than Redux. Maybe because it had the luxury of coming after Redux/similar projects and underpinning a simpler parent framework.
You can still use the function prop pattern in Vue but it doesn’t make much sense when event emission is so much simpler to reason about.
This is where I've found Vuex is a life saver for reducing complexity, organizing state in a seperate area, and having a consistent interface for accessing/mutating data without a tangled web of events and functions across multiple files/layers.
Action handler gets data, does business logic stuff, sends result off to reducer that publishes the data back to the UI layer.
Online explanations of this suck.
On the other hand, redux's reducers are harder to visualize at the beginning. Until you learn how the reducer works, every reference to "reducer" leaves you slightly confused.
I visualized redux's better with a simple example. It helps you to see how state and reducers interact.
All state was owned by the master MCU, slave MCU sent messages to the master requesting changes of state, the entire state for the slave CPU was then sent over with the requested changes.
Even what UI screen was shown was handled this way.
I was much more junior then, so the entire system wasn't event driven, all state was transferred every 33ms (iirc).
Redux is moderately more complex than that system, although my system was built in pure C and involved interop between C and C# running in an interpreter.