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

[no-issue] fix: 예시 코드 정리 #140

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from all 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
20 changes: 10 additions & 10 deletions pages/docs/app/api-reference/functions/unstable_cache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ const data = unstable_cache(fetchData, keyParts, options)()
import { unstable_cache } from 'next/cache';

export default async function Page({ params }: { params: { userID: string } }) {
const getCachedUser = unstable_cache(
async () => {

return { id: params.userID };
const getCachedUser = unstable_cache(
async () => {
return { id: params.userId }
},
[params.userID], // 여기서 userID를 keyParts에 추가하여 Next.js가 서로 다른 userID에 대해 별도의 캐시를 만들 수 있도록 합니다.
{
tags: ["cached-user-tag"],
revalidate: 60,
}
);
);

...
}
```
Expand All @@ -70,17 +70,17 @@ export default async function Page({ params }: { params: { userID: string } }) {
import { unstable_cache } from 'next/cache';

export default async function Page({ params }) {
const getCachedUser = unstable_cache(
async () => {

return { id: params.userID };
const getCachedUser = unstable_cache(
async () => {
return { id: params.userId }
},
[params.userID], // 여기서 userID를 keyParts에 추가하여 Next.js가 서로 다른 userID에 대해 별도의 캐시를 만들 수 있도록 합니다.
{
tags: ["cached-user-tag"],
revalidate: 60,
}
);
);

...
}
```
Expand Down
Loading