-
-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Description
const mergedOptions = {
// 默认配置
manual: true,
// 缓存配置
cacheKey: ${apiFunc.name}_${Math.random().toString(36).slice(2, 11)},
cacheTime: 5 * 60 * 1000, // 5分钟缓存
staleTime: 2 * 60 * 1000, // 2分钟 stale time
// 防抖配置
debounceInterval: 300,
// 刷新配置
refreshDeps: [],
// 轮询配置
pollingInterval: 0,
// 重试配置 - 明确禁用
retry: false,
retryCount: 0,
errorRetryCount: 0,
errorRetryInterval: 0,
// 错误处理
onError: (error) => {
console.error('API 请求错误:', error)
},
// 成功处理
onSuccess: (data) => {/* */
console.log('API 请求成功:', data)
},
}
配置如上所示
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels