-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watched Previous Values can't be Destructure on First Fire #418
Comments
That's the same behaviour as you have in vue3. AFAIK this is the expected behaviour since you are deconstructing an |
@klondikemarlen This should work for you watch(
[unitId, entityType],
([newUnitId, newEntityType], [oldUnitId, oldEntityType]) => {
}
) |
Hope it solves your problem. Closing for now. |
I know that I can't destructure an undefined. :P I want the watch function to always return an array if it is operating on an array of args. |
When I try passing in an array instead of a function, I get the same destructuring error. |
I will have a look |
If this is expected behaviour, then I suggest updating the documentation to make it more clear. It is a bit confusing to get an error after using the 'Watching Multiple Sources'-example. |
When? watching an array of values I can't destructure the previous values on the initial loop run.
Why? the previous values are returned as
undefined
.What I expect? I expect the previousValue on initial run to be equal to
[undefined, undefined]
so I can destructure it properly.Code I have to write:
Code I want to write:
The text was updated successfully, but these errors were encountered: