⬆ ️ deps: Bump swr from 1.1.2 to 1.2.1
Bumps swr from 1.1.2 to 1.2.1.
Release notes
Sourced from swr's releases.
1.2.1
Highlights of This Release
shouldRetryOnError
accepts a functionPreviously
shouldRetryOnError
is either true or false. Now it accepts a function that conditionally determines if SWR should retry. Here's a simple example:const fetcher = url => fetch(url).then(res => { // Fetcher throws if the response code is not 2xx. if (!res.ok) throw res return res.json() }) useSWR(key, fetcher, { shouldRetryOnError: (error) => { // We skip retrying if the API is returning 404: if (error.status === 404) return false return true } })
Thanks to
@sairajchouhan
for contributing!What's Changed
shouldRetryOnError
accepts a function that can be used to conditionally stop retrying by@sairajchouhan
in vercel/swr#1816- build(deps-dev): bump next from 12.0.8 to 12.0.9 by
@dependabot
in vercel/swr#1821- fix: useSWRInfinite revalidates with revalidateOnMount by
@koba04
in vercel/swr#1830New Contributors
@sairajchouhan
made their first contribution in vercel/swr#1816Full Changelog: https://github.com/vercel/swr/compare/1.2.0...1.2.1
1.2.0
Highlights of This Release
Optimistic Updates with Auto Error Rollback
There are now some new options in
mutate
:mutate(patchUser(user), { optimisticData: user, populateCache: true, rollbackOnError: true, revalidate: true, })
... (truncated)
Commits
-
c63cafc
1.2.1 -
922048e
fix: useSWRInfinite revalidates with revalidateOnMount (#1830) -
a4ab0c9
build(deps-dev): bump next from 12.0.8 to 12.0.9 (#1821) -
53dc100
feat: shouldErrorRetry accepts a function (#1816) -
bfb9edc
1.2.0 -
e3dc48a
fix: use the latest reference of fetcher with suspense mode (#1803) -
fdd5c33
Add link to security email directly (#1795) -
7dfd890
chore: Move community health files to .github (#1794) -
c9793ac
chore: Clean up configurations (#1792) -
3a7dd3b
test: use@swc/jest
(#1790) - Additional commits viewable in compare view