fix(types): cookie options are optional

This commit is contained in:
Sébastien Chopin 2021-11-23 01:23:33 +01:00
parent 5fdefed39e
commit c3b72a6ee2

View File

@ -19,7 +19,7 @@ const CookieDefaults: CookieOptions<any> = {
encode: val => encodeURIComponent(typeof val === 'string' ? val : JSON.stringify(val))
}
export function useCookie <T=string> (name: string, _opts: CookieOptions<T>): CookieRef<T> {
export function useCookie <T=string> (name: string, _opts?: CookieOptions<T>): CookieRef<T> {
const opts = { ...CookieDefaults, ..._opts }
const cookies = readRawCookies(opts)