hooks icon indicating copy to clipboard operation
hooks copied to clipboard

请求 useRequest 的 refresh 支持忽略 staleTime

Open whinc opened this issue 1 year ago • 1 comments

背景

useRequest 默认情况下设置 staleTime 后,在 staleTime 到期前,调用 refresh 是不会重新发起请求的,但在某些场景下(例如强制刷新),这可能并不符合预期,期望 refresh 能支持忽略 staleTime 强制重新发起请求,可能的 API 为 refresh(force: boolean): void 或者 refresh(options?: { skipStaleTime:? boolean }): void

whinc avatar Nov 03 '23 07:11 whinc

可能的 API 为 refresh(force: boolean): void 或者 refresh(options?: { skipStaleTime:? boolean }): void

是有这种场景,可以考虑支持

liuyib avatar Nov 06 '23 02:11 liuyib