Skip to content

Commit 17b667c

Browse files
committed
feat: handle updates in observers
1 parent 2d9c8ff commit 17b667c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client/app/pages/vue-query.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ function onQueryNotification(event: QueryCacheNotifyEvent) {
2525
case 'observerResultsUpdated':
2626
// When data becomes stale/invalidate etc, the query is updated
2727
// fall through
28+
case 'observerAdded':
29+
// fall through
30+
case 'observerRemoved':
31+
// fall through
2832
case 'updated': {
2933
const query = queries.value.find(q => q.queryHash === event.query.queryHash)
3034
if (query) {
@@ -45,8 +49,8 @@ function onQueryNotification(event: QueryCacheNotifyEvent) {
4549
}
4650
break
4751
}
48-
default:
49-
console.log('Unknown event', event.type)
52+
case 'observerOptionsUpdated':
53+
// TODO
5054
break
5155
}
5256
}
@@ -246,10 +250,10 @@ function handleRestoreTriggerLoading(query: Query) {
246250
{{ selectedQuery?.queryKey }}
247251
</div>
248252
<div>
249-
<strong>Query Hash:</strong>
253+
<strong>Observers:</strong>
250254
</div>
251255
<div>
252-
{{ selectedQuery?.queryHash }}
256+
{{ selectedQuery.observers.length }}
253257
</div>
254258
<div>
255259
<strong>Overall status:</strong>

0 commit comments

Comments
 (0)