question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

watch not working on data ref

See original GitHub issue

First of all, thank you for your great work in this library. I encountered an issue when replacing useAsyncState with useQuery in my project. It seems that the data ref cannot be watched, i.e the watcher doesn’t respond when data is fetched from the API. As a result useStorage from vue-use does not work on vue-query data.

I’ve prepared a codesandbox that demonstrates the issue here. When you select a user from the users’ list you’ll notice that although the user data gets updated, the watcher (which is setup inside store.js) does not fire. When you replace useQuery with useAsyncState inside the Users.vue file, the watcher fires as expected. I’ve also tried the same thing with swrv and the watcher fires as expected as well.

Watch not working with vue-query watch-not-working

Watch working with vue-use useAsyncState watch-working

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wobsorianocommented, Mar 27, 2022

Ah yes the readonly wrap can be removed there I think

0reactions
Mosaab-Emamcommented, Dec 2, 2022

Thanks @Holi0317, watching dataUpdatedAt fixed it for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Apple Watch "Set Up Mobile Data" not working (Refe...
Apple Watch "Set Up Mobile Data" not working (Reference Code 112) · 1. Open the Watch app on your iPhone and tap on...
Read more >
How to Watch Props Change with Vue Composition API / Vue 3?
Problem is from that point that selected ref is completely disconnected from the props.selected value (if prop value changes, ref will not).
Read more >
Why Isn't My Apple Watch Pairing? 5 Ways to Fix It
If your Apple Watch isn't pairing with your iPhone, there are a number of ways you can fix the connection. Here's what you...
Read more >
Watchers | Vue.js
Watchers declared using the watch option or the $watch() instance method are automatically stopped when the owner component is unmounted, so in most...
Read more >
If Maps isn't working on your Apple device
Turn on Location Services and Location Access for Maps. In the Settings app, tap Privacy, then tap Location Services.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found