3 ms·
Here's how I model it: the view is a function of state; and actions create a new state, which re-renders the view. state -> view -> actions -
by lioeters 3y ago
Here's how I model it: the view is a function of state; and actions create a new state, which re-renders the view.
state -> view -> actions -
|
^-----------------------
Actions can be from the user via the view, but it can come from elsewhere, for example, websocket events.
I like what another commenter said about a "stream of events", though in my mind an action is more limited than an event. An action has no event handlers, it can only dispatch state changes (or other actions).