Skip to content

Commit

Permalink
types: refactor ref unwrapping (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin authored and yyx990803 committed Jan 20, 2020
1 parent 98d50d8 commit 0c42a6d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/reactivity/src/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ export type UnwrapRef<T> = {
object: { [K in keyof T]: UnwrapRef<T[K]> }
}[T extends ComputedRef<any>
? 'cRef'
: T extends Ref
? 'ref'
: T extends Array<any>
? 'array'
: T extends Function | CollectionTypes | BaseTypes
? 'ref' // bail out on types that shouldn't be unwrapped
: T extends object ? 'object' : 'ref']
: T extends Array<any>
? 'array'
: T extends Ref | Function | CollectionTypes | BaseTypes
? 'ref' // bail out on types that shouldn't be unwrapped
: T extends object ? 'object' : 'ref']

0 comments on commit 0c42a6d

Please sign in to comment.