redux 的用法
import {createStore} from 'redux'
const store = createStore(counter);
store.dispatch({type:'INCREMENT'});
const counter =( state =0,action)=>{
switch(action.type){
case 'INCREMENT':
return state+1
default:
state
}
}
store.subscribe(()=>{
console.log(store.getState())
})