initial layout
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import Cookies from "js-cookie"
|
||||
|
||||
export const useCookie = (key: string, defaultValue: string | null = null) => {
|
||||
const getCookie = Cookies.get(key) || defaultValue
|
||||
const setCookie = (value: string) => Cookies.set(key, value)
|
||||
const removeCookie = () => Cookies.remove(key)
|
||||
|
||||
return [getCookie, setCookie, removeCookie] as [
|
||||
string | null,
|
||||
(value: string) => void,
|
||||
() => void,
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user