UNPKG

@vue-widget/hooks

Version:

hooks from react to vue

4 lines (3 loc) 318 B
import type { Ref } from "vue"; export type SetStates<S extends Record<string, any>> = <K extends keyof S>(state: Pick<S, K> | null | ((prevState: Readonly<S>) => Pick<S, K> | S | null)) => void; export declare const useSetState: <S extends Record<string, any>>(initialState: S | (() => S)) => [Ref<S>, SetStates<S>];