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

export default function*() {
    yield fork(through('EDIT_BANNER', updateItem, '修改'));
    yield fork(watch('CREATE_BANNER', createItem, '创建'));
    yield fork(watch('UPDATE_BANNER', updateItem, ''));
    yield fork(watch('FETCH_BANNER_LIST', fetchList));
    yield fork(watch('FETCH_BANNER', fetchItem));
}
