Skip to content

Commit 9ad1169

Browse files
committed
add comment on setting is loading
1 parent f78c8e1 commit 9ad1169

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/db/src/query/live/collection-subscriber.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ export class CollectionSubscriber<
7575

7676
// Subscribe to subscription status changes to propagate loading state
7777
const statusUnsubscribe = subscription.on(`status:change`, (event) => {
78+
// TODO: For now we are setting this loading state whenever the subscription
79+
// status changes to 'loadingMore'. But we have discussed it only happening
80+
// when the the live query has it's offset/limit changed, and that triggers the
81+
// subscription to request a snapshot. This will require more work to implement,
82+
// and builds on https://github.com/TanStack/db/pull/663 which this PR
83+
// does not yet depend on.
7884
if (event.status === `loadingMore`) {
7985
// Guard against duplicate transitions
8086
if (!this.subscriptionLoadingPromises.has(subscription)) {

0 commit comments

Comments
 (0)