MCPcopy Create free account
hub / github.com/TanStack/db / emitEvents

Method emitEvents

packages/db/src/collection/subscription.ts:321–333  ·  view source on GitHub ↗
(changes: Array<ChangeMessage<any, any>>)

Source from the content-addressed store, hash-verified

319 }
320
321 emitEvents(changes: Array<ChangeMessage<any, any>>) {
322 const newChanges = this.filterAndFlipChanges(changes)
323
324 if (this.isBufferingForTruncate) {
325 // Buffer the changes instead of emitting immediately
326 // This prevents a flash of missing content during truncate/refetch
327 if (newChanges.length > 0) {
328 this.truncateBuffer.push(newChanges)
329 }
330 } else {
331 this.filteredCallback(newChanges)
332 }
333 }
334
335 /**
336 * Sends the snapshot to the callback.

Callers

nothing calls this directly

Calls 1

filterAndFlipChangesMethod · 0.95

Tested by

no test coverage detected