import { routerRedux } from 'dva/router';
import * as productService from '../../services/FM/product';

export default {

  namespace: 'FMProduct',
  state: {
  },

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

    },
  },

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

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

};
