vue-hooks-plus
Version:
Vue hooks library
8 lines (7 loc) • 407 B
TypeScript
import { Ref, UnwrapRef, DeepReadonly, UnwrapNestedRefs } from 'vue';
type UseSetStateType<S> = S | (() => S) | Ref<S> | (() => Ref<S>);
declare function useSetState<S extends Record<string, any>>(initialState: UseSetStateType<S>): [
DeepReadonly<UnwrapNestedRefs<[S] extends [Ref<any>] ? S : Ref<UnwrapRef<S>>>>,
(patch: Record<string, any>, cover?: boolean) => void
];
export default useSetState;