Functions can contain conditional logic other than switch statements, functions can be composed to wrap each other, and functions can call other functions. Reducer pure function
Since immutable data updates require all ancestors in the state tree to be copied and updated as well, and new object references will cause connected UI components to re-render, an update to a deeply nested data object could force totally unrelated UI components to re-render even if the data they're displaying hasn't actually changed. 所以React-redux在做绑定的时候connect对mapState做了简单地计算,比较前后内部state是否一致.
Reusing reducer logic maybe HOC (reducer) => { another reducer}
imuutable function builts in JS:slice、concat、assign、fronze
Structuring Reducers notes
Structuring Reducers