400 028 6601

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

react-redux基本使用

  1. 图解:
    react-redux基本使用
  2. 代码:
    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})
  3. 效果:
    react-redux基本使用

网站栏目:react-redux基本使用
URL标题:http://mzwzsj.com/article/ppocoi.html

其他资讯

让你的专属顾问为你服务