|
|
@@ -16,6 +16,21 @@ export default {
|
|
|
});
|
|
|
const response = yield call(queryFakeList, payload);
|
|
|
yield put({
|
|
|
+ type: 'queryList',
|
|
|
+ payload: Array.isArray(response) ? response : [],
|
|
|
+ });
|
|
|
+ yield put({
|
|
|
+ type: 'changeLoading',
|
|
|
+ payload: false,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ *appendFetch({ payload }, { call, put }) {
|
|
|
+ yield put({
|
|
|
+ type: 'changeLoading',
|
|
|
+ payload: true,
|
|
|
+ });
|
|
|
+ const response = yield call(queryFakeList, payload);
|
|
|
+ yield put({
|
|
|
type: 'appendList',
|
|
|
payload: Array.isArray(response) ? response : [],
|
|
|
});
|
|
|
@@ -27,6 +42,12 @@ export default {
|
|
|
},
|
|
|
|
|
|
reducers: {
|
|
|
+ queryList(state, action) {
|
|
|
+ return {
|
|
|
+ ...state,
|
|
|
+ list: action.payload,
|
|
|
+ };
|
|
|
+ },
|
|
|
appendList(state, action) {
|
|
|
return {
|
|
|
...state,
|