Skip to content
On this page

useFetchs

Based on useRequest's ability to implement powerful parallel requests, gracefully manage multiple identical URLs carrying different parameters.

Code demonstration

API

const { fetchRun, fetchs } = useFetchs(service, options, {
  fetchKey: params => string | number,
})
const { fetchRun, fetchs } = useFetchs(service, options, {
  fetchKey: params => string | number,
})

Result

参数说明类型默认值
fetchsStatus of all requests collectedReadonly<FetchType<TData, TParams>>-
fetchRunFunctions that you need to run(...args) => void-

Params

参数说明类型默认值
serviceService functionUseRequestService<TData, ParamsType<TParams>>-
optionsAdditional Configuration ItemsuseRequest Options-
selfself options fetchKey(...args: ParamsType<TParams>) => string-

Options

Referring to the option of useRequest, note that fetchRun needs to be true in manual mode

PropertyDescriptionType
fetchKeyGet key, cacheKey for useRequest(...args) => string | number

Source

SourceDocsDemo