你的浏览器不支持canvas

react的redux中间件

redux 的中间件(对dispatch功能的拦截和增强,一般不用自己写,有插件)

dispath是一个方法,可以自行中间拦截更改:

store.dispatch = function(action){
console.log("dispatch执行了")

 next(action);

console.log("执行后的dispatch",store.getState) 

 

二、CreateStore的参数:

参数1:reducer;

参数2:init state;

参数3:使用的中间件; 

 

logger插件增强dispatch的功能,在dispatch时打印日志,得到dispatch之前和之后的state;

posted @ 2018-08-21 11:25  云上丶无忧  阅读(228)  评论(0编辑  收藏  举报

来场流星雨,吧