From 136055004ac1dfda609bff29719eef3db551611b Mon Sep 17 00:00:00 2001 From: huozhi Date: Fri, 8 Jan 2021 11:30:32 +0800 Subject: [PATCH 1/2] docs: add field for config.isPaused --- pages/docs/options.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/docs/options.mdx b/pages/docs/options.mdx index 7c3574ed..4f9248e9 100644 --- a/pages/docs/options.mdx +++ b/pages/docs/options.mdx @@ -40,6 +40,7 @@ const { data, error, isValidating, mutate } = useSWR(key, fetcher, options) - `onError(err, key, config)`: callback function when a request returns an error - `onErrorRetry(err, key, config, revalidate, revalidateOps)`: handler for error retry - `compare(a, b)`: comparison function used to detect when returned data has changed, to avoid spurious rerenders. By default, [dequal](https://github.com/lukeed/dequal) is used. +- `isPaused()`: function to detect whether pause revalidations, will ignore fetched data and errors when it returns `true`. returns `false` by default. When under a slow network (2G, {'<='} 70Kbps), errorRetryInterval will be 10s, and{' '} From 2199c70bde5bdab2b5b30dbe4578344b159e2590 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 8 Jan 2021 14:32:53 +0800 Subject: [PATCH 2/2] returns -> Returns Co-authored-by: Shu Ding --- pages/docs/options.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/options.mdx b/pages/docs/options.mdx index 4f9248e9..74ab69a0 100644 --- a/pages/docs/options.mdx +++ b/pages/docs/options.mdx @@ -40,7 +40,7 @@ const { data, error, isValidating, mutate } = useSWR(key, fetcher, options) - `onError(err, key, config)`: callback function when a request returns an error - `onErrorRetry(err, key, config, revalidate, revalidateOps)`: handler for error retry - `compare(a, b)`: comparison function used to detect when returned data has changed, to avoid spurious rerenders. By default, [dequal](https://github.com/lukeed/dequal) is used. -- `isPaused()`: function to detect whether pause revalidations, will ignore fetched data and errors when it returns `true`. returns `false` by default. +- `isPaused()`: function to detect whether pause revalidations, will ignore fetched data and errors when it returns `true`. Returns `false` by default. When under a slow network (2G, {'<='} 70Kbps), errorRetryInterval will be 10s, and{' '}