-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Closed
Description
Version
3.2.0-beta.4
Reproduction link
Steps to reproduce
const object = ref({ count: 1 });
typeof readonly(object);
const variable = ref(1);
typeof readonly(variable);
What is expected?
const object = ref({ count: 1 });
readonly(object); // Ref<DeepReadonly<...>>
const variable = ref(1);
readonly(variable); // Ref<Readonly<number>>
What is actually happening?
const object = ref({ count: 1 });
readonly(object); // DeepReadonly<Ref<...>>
const variable = ref(1);
readonly(variable); // DeepReadonly<Ref<number>>
I'm using the readonly
function with a Ref<Object[]>
.
In 3.1.5 the result of function call is a Ref<DeepReadonly<Object[]>>
and with a simple ref like Ref<string>
the result is Ref<Readonly<string>>
Since 3.2.0-beta.1 a primitive type like string the result is no more Ref<Readonly<string>>
but DeepReadonly<Ref<string>>
and using the ref in a watch context the new / old value seems to be the ref instead of the value changed.
And the object from Ref<DeepReadonly<...>>
became DeepReadonly<Ref<...>>
Metadata
Metadata
Assignees
Labels
No labels