react-redux基本使用-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

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://kswsj.cn/article/ppocoi.html

其他资讯