大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
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})