refactor: provider 레이어 변경 & 누락된 public api 수정

This commit is contained in:
2025-03-17 18:28:17 +09:00
parent 0b9b5bd22c
commit 4ed2a45486
32 changed files with 49 additions and 136 deletions
@@ -0,0 +1,30 @@
"use client";
import { createContext } from "react";
import { getCookie, setCookie, removeCookie } from "./cookie";
export interface CookieContextType {
getCookie: (name: string) => string | undefined;
setCookie: (
name: string,
value: string,
options: Cookies.CookieAttributes,
) => void;
removeCookie: (name: string, options: Cookies.CookieAttributes) => void;
}
export const CookieContext = createContext<CookieContextType | null>(null);
export function CookieProvider({ children }: { children: React.ReactNode }) {
const cookieContextValue: CookieContextType = {
getCookie,
setCookie,
removeCookie,
};
return (
<CookieContext.Provider value={cookieContextValue}>
{children}
</CookieContext.Provider>
);
}
+2
View File
@@ -0,0 +1,2 @@
export { CookieProvider } from "./cookie-provider";
export { getCookie, setCookie, removeCookie } from "./cookie";