const INCREMENT = 'INCREMENT'
const DECREMENT = 'DECREMENT'

const initState = {
  appName:'FireSoon WeApp'
  count: 0
}

export default {
  namespace: 'apps',
  state: initState,
  effects: {
    *increment(_: void, { put }: DvaApi) {
      yield put({ type: INCREMENT })
    },
    *decrement(_: void, { put }: DvaApi) {
      yield put({ type: DECREMENT })
    },
  },
  reducers: {
    INCREMENT(state: any): any {
      return Object.assign({}, state, {
        count: state.count + 1,
      })
    },
    DECREMENT(state: any): any {
      return Object.assign({}, state, {
        count: state.count - 1,
      })
    },
  },
};
