Of Love and Hate: TypeScript, Redux and Immutable.js
blog.mayflower.de
Of Love and Hate: TypeScript, Redux and Immutable.js
1–5 of 5 posts
Re: Of Love and Hate: TypeScript, Redux and Immutable.js
#2Re: Of Love and Hate: TypeScript, Redux and Immutable.js
#3I'm wondering why to bother with immutable.js, when redux already requires that state changes has to be immutable.
Re: Of Love and Hate: TypeScript, Redux and Immutable.js
#4I'm wondering why to bother with immutable.js, when redux already requires that state changes has to be immutable.
immutability of redux state is convention, but not enforced within redux. This example is react state, but the same problems arise with redux: https://twitter.com/brayoh_k/status/978539881243774976
Re: Of Love and Hate: TypeScript, Redux and Immutable.js
#5Earlier quoted context omitted.
immutability of redux state is convention, but not enforced within redux. This example is react state, but the same problems arise with redux: https://twitter.com/brayoh_k/status/978539881243774976
Maybe it's not enforced by redux itself, but you cannot use react-redux component then. React-redux will only rerender component , if state or part of it is new instance and not just mutated shallow copy, effectively requiring the state to be immutable.
I know that react-redux will only rerender if things changed through a dispatch (in fact, everything consuming redux.subsrcibe will not notice a side-effect change), but those things happen if you do not use some kind of immutability and especially if they have no immediate effect, it's a nightmare to debug.
Read the article, this is discussed in the first few paragraphs.