Adding a watcher inside `useAsyncData`
Hi.
I've wrapped
However now I want to submit an error to sentry in case of errors. If I use
However I can add a watcher on error and that seems to work:
However something about this approach seems wrong to me. Is using a watcher like this bad practice? If not, do I need to manually unsubscribe the watcher on unMount? Is there a better way to do this?
I've wrapped
useAsyncData in order to add some error handling:However now I want to submit an error to sentry in case of errors. If I use
error.value inside myAsyncData, i'll lose reactivity so I don't want to do that.However I can add a watcher on error and that seems to work:
However something about this approach seems wrong to me. Is using a watcher like this bad practice? If not, do I need to manually unsubscribe the watcher on unMount? Is there a better way to do this?