Skip to content

Commit

Permalink
fix: improve MaybeComputedRef
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Aug 4, 2022
1 parent fa2f6b8 commit 28c5a95
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/shared/utils/types.ts
@@ -1,4 +1,4 @@
import type { Ref, WatchOptions, WatchSource } from 'vue-demi'
import type { ComputedRef, Ref, WatchOptions, WatchSource } from 'vue-demi'

/**
* Any function
Expand Down Expand Up @@ -34,9 +34,7 @@ export type MaybeRef<T> = T | Ref<T>
* type MaybeComputedRef<T> = T | Ref<T> | (() => T)
* ```
*/
export type MaybeComputedRef<T> = T extends () => void
? never
: (() => T) | MaybeRef<T>
export type MaybeComputedRef<T> = (() => T) | T | Ref<T> | ComputedRef<T>

/**
* Make all the nested attributes of an object or array to MaybeRef<T>
Expand Down

0 comments on commit 28c5a95

Please sign in to comment.