Skip to content

Commit

Permalink
fix(types): allow any object in toRefs (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Mar 29, 2021
1 parent 4fcea65 commit 7284ad9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/reactivity/ref.ts
@@ -1,4 +1,3 @@
import { Data } from '../component'
import { RefKey } from '../utils/symbols'
import { proxy, isPlainObject, warn } from '../utils'
import { reactive, isReactive, shallowReactive } from './reactive'
Expand Down Expand Up @@ -119,7 +118,7 @@ export function unref<T>(ref: T): T extends Ref<infer V> ? V : T {
return isRef(ref) ? (ref.value as any) : ref
}

export function toRefs<T extends Data = Data>(obj: T): ToRefs<T> {
export function toRefs<T extends object>(obj: T): ToRefs<T> {
if (__DEV__ && !isReactive(obj)) {
warn(`toRefs() expects a reactive object but received a plain one.`)
}
Expand Down

0 comments on commit 7284ad9

Please sign in to comment.