import { prepareStore } from 'redux-zap' const initialState = { count: 0, counting: false } export default prepareStore(initialState, { // Action "reset" that set count to 0 // We return a partial state that will be applied to the current state reset: () => ({ count: 0 }), // Action "increment" that increments the count // We need the previous state, we can get it by returning a function increment: (n) => state => ({ count: state.count + n }) })