e-schultz / ng-summit-redux

BSD 2-Clause "Simplified" License
101 stars 24 forks source link

Remove Immutable.js #2

Open wbuchwalter opened 9 years ago

wbuchwalter commented 9 years ago

I'm creating an issue here to talk about that because the PR is getting quite hard to follow with all our comments.

Following on what you said about passing down a a mutable order list, why would this be an issue? It could cause an issue if you are mutating it, but this shouldn't happen.

In production, I (sadly) enforce immutability by convention (because TypeScript), but so far it works well.

e-schultz commented 9 years ago

Think I'm going to go ahead and do this. Think I might just change all of my reducers to be operating on an array, and break orders out into it's own reducer.

Each one becomes a pretty simple array of objects, each reducer gets more of a singular focus - and think it will clarify the code examples and slides more.

wbuchwalter commented 9 years ago

Array in reducers is not a great idea when dealing with complex applications, hashmaps are usually better suited, but for a demo, arrays have the advantages of being less verbose -> more readbale reducers.

Maybe just add a sidenote somewhere explaining that.

Throwing some random related resources: https://github.com/gaearon/normalizr http://rackt.github.io/redux/docs/basics/Reducers.html (Note on Relationships) https://github.com/rackt/redux/issues/316