Change update to reducers
See original GitHub issueI used update
because that’s how Elm calls it, but now that I am in the process of documenting HyperApp more thoroughly, I find myself explaining that update is an object composed of reducers, which begs the question, why then not just call it reducers?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Actions and reducers: updating state - Human Redux
The simplest possible way to update a view is just store.subscribe() and then in that function, call store.getState() and re-render. ... For our...
Read more >Right way to update state in redux reducers - Stack Overflow
We're just running our new reducer over each post in the list, to return an updated array of posts. In this case, the...
Read more >Redux Fundamentals, Part 3: State, Actions, and Reducers
The official Redux Fundamentals tutorial: learn how reducers update state in response to actions.
Read more >An intro to Redux and how state is updated ... - freeCodeCamp
The only way to update a state inside a store is to dispatch an action and define a reducer function to perform tasks...
Read more >Few Ways to Update a State Array in Redux Reducer - Medium
First, we will find the index of the item in the array using findIndex() . Then we make a copy of the todos...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/hyperapp/hyperapp/commit/7a60a8f18163c31ec74c174c18337b7a31ae2dfb
I’ve changed it to reducers, but still back supporting
update
, which should be deprecated by 0.6.0 or later.I think vuex choice is acceptable, since it’s really obvious your’re mutating a value.
However, in HyperApp, things are slightly different:
…
We don’t mutate the model, but rather create a new one from the old one.
Now, in reality, hyperapp does mutate the model, because that was simpler to implement and maintain than this:
But now, that’s an implementation detail 😆