[IMP] reactivity: toRaw now works with non reactive objects

This commit is contained in:
Géry Debongnie
2022-02-15 16:37:03 +01:00
committed by Samuel Degueldre
parent bb9d65e95b
commit 12b8ce963e
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ export function markRaw<T extends Target>(value: T): NonReactive<T> {
* @returns the underlying value
*/
export function toRaw<T extends object>(value: Reactive<T>): T {
return value[TARGET];
return value[TARGET] || value;
}
const targetToKeysToCallbacks = new WeakMap<Target, Map<ObjectKey, Set<Callback>>>();