Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
19 lines
418 B
Plaintext
19 lines
418 B
Plaintext
import { cache } from 'react';
|
|
|
|
// See https://github.com/vercel/next.js/discussions/58862
|
|
function getCacheImpl() {
|
|
const value = {
|
|
locale: undefined
|
|
};
|
|
return value;
|
|
}
|
|
const getCache = cache(getCacheImpl);
|
|
function getCachedRequestLocale() {
|
|
return getCache().locale;
|
|
}
|
|
function setCachedRequestLocale(locale) {
|
|
getCache().locale = locale;
|
|
}
|
|
|
|
export { getCachedRequestLocale, setCachedRequestLocale };
|