import {takeEvery, put} from 'redux-saga/effects';
import {INIT_LIST_DATA} from './actionTypes'
import "./actionTypes";
import axios from "axios";
function *getList() {
console.log('getInitList')
const res = yield axios.get('http://47.104.103.63/project/react/todolist/todolist.json');
const data = res.data
yield put({
type: INIT_LIST_DATA,
value: data
})
}
// generator 函数
function *mySaga() {
console.log('mySaga')
yield takeEvery(INIT_LIST_DATA, getList)
}
export default mySaga;