bindActionCreators 用法 bindReducers用法 以及原理

在此之前都快忘了这个方法了,先介绍一下用法:

还是以原生js,index.html 为例子,

 bindActionCreators可以绑定多个actionCreator         actionCreator其实就是一个对象   ,bindActionCreators的目的在于把store的dispatch和actionCreator结合

但是这样每次调用bindActionCreators好像也并不好,所以我们调用一次bindActionCreators,但是第一个参数actionCreator是个对象    ,最后返回的也是一个对象boundActions

 bindActionCreators  源码:

 bindRducers的原理

 其实这

原文地址:https://www.cnblogs.com/MDGE/p/14367837.html