提交 4c8ef953 编写于 作者: J JoeyKo 提交者: 偏右

fix fetchMore

上级 62ab8b47
......@@ -15,6 +15,13 @@ export default {
payload: Array.isArray(response) ? response : [],
});
},
*appendFetch({ payload }, { call, put }) {
const response = yield call(queryFakeList, payload);
yield put({
type: 'appendList',
payload: Array.isArray(response) ? response : [],
});
},
*submit({ payload }, { call, put }) {
let callback;
if (payload.id) {
......@@ -37,5 +44,11 @@ export default {
list: action.payload,
};
},
appendList(state, action) {
return {
...state,
list: state.list.concat(action.payload),
};
},
},
};
......@@ -19,7 +19,13 @@ const pageSize = 5;
}))
class SearchList extends Component {
componentDidMount() {
this.fetchMore();
const { dispatch } = this.props;
dispatch({
type: 'list/fetch',
payload: {
count: 5,
},
});
}
setOwner = () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册