Skip to content
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

docs: add mutate filter functions documentation in v2 #340

Merged
merged 3 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pages/docs/advanced/cache.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import { Cache } from 'components/diagrams/cache'
When nested, SWR hooks will use the upper-level cache provider. If there is no upper-level cache provider, it fallbacks to the default cache provider, which is an empty `Map`.

<Callout emoji="⚠️">
If a cache provider is used, the global `mutate` will **not** work for SWR hooks under that `<SWRConfig>` boundary. Please use [this](#access-current-cache-provider) instead.
If a cache provider is used, the global `mutate` will **not** work for SWR hooks under that `<SWRConfig>` boundary. Please use [this](#access-current-cache-provider) instead.
</Callout>

## Access Current Cache Provider
Expand Down Expand Up @@ -197,3 +197,5 @@ const { cache } = useSWRConfig()
cache.get(key) // Get the current data for a key.
cache.clear() // ⚠️ Clear all the cache. SWR will revalidate upon re-render.
```

You can use [`mutate`](/docs/mutation) to modify the cache.
2 changes: 2 additions & 0 deletions pages/docs/advanced/cache.ja.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,5 @@ const { cache } = useSWRConfig()
cache.get(key) // キーの現在のデータを取得します。
cache.clear() // ⚠️ すべてのキャッシュをクリアします。 SWRは、再レンダリング時に再検証します。
```

[`mutate`](/docs/mutation) をキャッシュを更新するために利用できます。
2 changes: 2 additions & 0 deletions pages/docs/advanced/cache.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,5 @@ const { cache } = useSWRConfig()
cache.get(key) // 키에 대한 현재 데이터 가져오기.
cache.clear() // ⚠️ 모든 캐시를 삭제하기. SWR은 다시 렌더링할 때 재검증합니다.
```

You can use [`mutate`](/docs/mutation) to modify the cache.
Loading