UNPKG

@vue-widget/hooks

Version:

hooks from react to vue

7 lines (6 loc) 397 B
import Cookies from "js-cookie"; export type State = string | undefined; export interface Options extends Cookies.CookieAttributes { defaultValue?: State | (() => State); } export declare function useCookieState(cookieKey: string, options?: Options): readonly [import("vue").Ref<State, State>, (newValue: State | ((prevState: State) => State), newOptions?: Cookies.CookieAttributes) => void];