Skip to content

Commit

Permalink
fix(useCloned): correct return type (#3711)
Browse files Browse the repository at this point in the history
  • Loading branch information
17359898647 committed Feb 20, 2024
1 parent 48421b2 commit e262fe2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/useCloned/index.ts
@@ -1,6 +1,6 @@
import type { MaybeRefOrGetter } from '@vueuse/shared'
import { toValue } from '@vueuse/shared'
import type { ComputedRef, WatchOptions } from 'vue-demi'
import type { Ref, WatchOptions } from 'vue-demi'
import { isRef, ref, watch } from 'vue-demi'

export interface UseClonedOptions<T = any> extends WatchOptions {
Expand All @@ -23,7 +23,7 @@ export interface UseClonedReturn<T> {
/**
* Cloned ref
*/
cloned: ComputedRef<T>
cloned: Ref<T>
/**
* Sync cloned data with source manually
*/
Expand All @@ -39,8 +39,8 @@ export function cloneFnJSON<T>(source: T): T {
export function useCloned<T>(
source: MaybeRefOrGetter<T>,
options: UseClonedOptions = {},
) {
const cloned = ref<T>({} as T)
): UseClonedReturn<T> {
const cloned = ref({} as T) as Ref<T>
const {
manual,
clone = cloneFnJSON,
Expand Down

0 comments on commit e262fe2

Please sign in to comment.