import {Store} from "./Store";

export const store = new Store(function (state={x: 0}, action) {
    switch (action.type) {
        case 'inc': return {
            ...state,
            x: state.x + 1
        }
        case 'dec': return {
            ...state,
            x: state.x - 1
        }
        default: return state
    }
})