// import {takeLatest} from 'redux-saga';
// import {take, call, put, fork, cancel, select, race} from 'redux-saga/effects';
// import { fetchList, fetchItem, updateItem } from '../services/admin/resource';
// import {message} from 'antd';
// import {watchIndex, watchShow, watchCreate, watchEdit} from './RESTful';
//
// export default function*() {
//     const ID = 'RESOURCE';
//     yield fork(watchIndex(ID, fetchList));
//     yield fork(watchShow(ID, fetchItem));
//     yield fork(watchEdit(ID, updateItem));
// }

import {fork} from 'redux-saga/effects';
import {fetchList, fetchItem, updateItem} from '../services/admin/resource';
import {watch, through} from './RESTful';

export default function*() {
    yield fork(through('EDIT_RESOURCE', updateItem, '修改'));
    yield fork(watch('FETCH_RESOURCE_LIST', fetchList));
    yield fork(watch('FETCH_RESOURCE', fetchItem));
}
