-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hooks before and after request #42
Comments
@John60676 const delayLoading = () => {
let timerId: number;
if (loadingDelay) {
timerId = setTimeout(setState, loadingDelay, {
loading: true,
});
}
return () => timerId && clearTimeout(timerId);
}; 不知道能不能再这里有什么东西可以检测到 loading 的变化 |
@keuby 有了 |
嗯,这个没啥问题,不过 |
但是这个 目前希望的API形式是 const request = useRequest(server, {
onBefore(params, config) {},
onAfter(params, config) {},
}) |
v1.2.0 已发布 |
Usage
API
Options
(params: P) => void
(params: P) => void
The text was updated successfully, but these errors were encountered: