import { createStore, combineReducers } from 'redux'
export const count = createStore((state = 0, action) => {
switch (action.type) {
case 'IN_CREMENT':
return state + action.data
default:return state
}
})
const a = (state= 0)=> state
const b = (state= 10)=> state
export const stores = createStore(combineReducers({a,b}))
export const inCrement = (number)=> { type: 'IN_CREMENT', data: number }
import { stateSubStore, stateSubStoreAll } from 'react-redux-subscribe'
import { count, stores } from './reducers'
import { inCrement } from './actions'
export const stateSusApp = stateSubStore({count},{inCrement})
export const AppStateSus = stateSubStore({count},{inCrement})
export const AppStateSus2 = stateSubStoreAll({stores},{})
export const AppStateSus3 = stateSubStoreAll({stores, filter:['a']},{})
import {AppStateSus} from '../redux/index.js'
class App extends Component {
constructor(props) {
super(props);
AppStateSus(this)
console.log(this.state.count)
this.actions.inCrement(6)
console.log(this.state.count)
}
render(){return<div></div>}
}