通过阅读 redux源码,来更清晰的认识 redux middleware,subscribe 与 react-redux。
- createStore done
- applyMiddleware done
- combineReducers done
- bindActionCreators done
前一阵子通过 learnrx 学习了一下 function programming,现在再看redux,感觉redux真是短小而精悍,没有什么深奥的东西,只是使用函数式编程的**,对 function 进行一系列操作,进而实现了对应用状态的统一管理。很厉害。
为什么redux能这么火呢?一方面是react的推崇,一方面也是代码质量过硬。 redux在 npms 上的得分高达92,从代码中看,对于异常case的处理也非常严谨,可以说是滴水不漏,已经尽量对可以预见的error做了正确的处理,同时测试的coverage也非常高。火起来也是正常的。