const defaultState = {
	num: 0
}

export default (state = defaultState, action) => {
	let num

	switch (action.type) {
		case 'INCREMENT':
			num = state.num + 1
			return { ...state, num }
		case 'DECREMENT':
			num = state.num - 1
			return { ...state, num }
		default:
			return state
	}
}
