react-redux基本使用
- 图解:

- 代码:
var createStore = require('redux').createStore var indexStore = createStore(function(state=0,action){ switch(action.type){ case 1: return ++state case 0: return --state default: return state } }) indexStore.subscribe(function(){ console.log(indexStore.getState()) }) indexStore.dispatch({type:1}) - 效果:

当前名称:react-redux基本使用
网页路径:http://www.lzwzjz.cn/article/ppocoi.html


咨询
建站咨询
