import { routerRedux } from 'dva/router';
import * as codeRule from '../../services/PF/codeRule';

export default {

  namespace: 'codeRule',
  state: {
  },

  subscriptions: {
    setup({ dispatch, history }) {  // eslint-disable-line

    },
  },

  effects: {
    *GenSystemCode ({ payload,onComplete }, { call, put }) {
      const ret = yield call(codeRule.GenSystemCode, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    },

  },

  reducers: {
    save(state, action) {
      return { ...state, ...action.payload };
    },
  },

};
