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

export default function*() {
    yield fork(through('EDIT_ANNOUNCEMENT', updateItem, '修改'));
    yield fork(watch('UPDATE_ANNOUNCEMENT', updateItem, ''));
    yield fork(watch('CREATE_ANNOUNCEMENT', createItem, '创建'));
    yield fork(watch('FETCH_ANNOUNCEMENT_LIST', fetchList));
    yield fork(watch('FETCH_ANNOUNCEMENT', fetchItem));
}
