MCPcopy Create free account
hub / github.com/DTStack/dt-react-component / fetcher

Function fetcher

src/useList/demos/basic.tsx:8–19  ·  view source on GitHub ↗
(
    params
)

Source from the content-addressed store, hash-verified

6import getMockData, { type MockData } from './data';
7
8const fetcher: Fetcher<MockData, { current: number; pageSize: number; search?: string }> = (
9 params
10) => {
11 return new Promise<{
12 data: MockData[];
13 total: number;
14 }>((resolve) => {
15 setTimeout(() => {
16 resolve(getMockData(params));
17 }, 150);
18 });
19};
20
21export default () => {
22 const { error, params, loading, data, mutate } = useList(fetcher, () => ({

Callers

nothing calls this directly

Calls 1

getMockDataFunction · 0.70

Tested by

no test coverage detected