MCPcopy
hub / github.com/dvajs/dva / fetch

Function fetch

examples/user-dashboard/src/pages/users/models/users.js:16–26  ·  view source on GitHub ↗
({ payload: { page = 1 } }, { call, put })

Source from the content-addressed store, hash-verified

14 },
15 effects: {
16 *fetch({ payload: { page = 1 } }, { call, put }) {
17 const { data, headers } = yield call(usersService.fetch, { page });
18 yield put({
19 type: 'save',
20 payload: {
21 data,
22 total: parseInt(headers['x-total-count'], 10),
23 page: parseInt(page, 10),
24 },
25 });
26 },
27 *remove({ payload: id }, { call, put }) {
28 yield call(usersService.remove, id);
29 yield put({ type: 'reload' });

Callers 1

requestFunction · 0.50

Calls 1

putFunction · 0.85

Tested by

no test coverage detected