Classify accumulated changes into DeltaEvents and invoke the callback
()
| 759 | |
| 760 | /** Classify accumulated changes into DeltaEvents and invoke the callback */ |
| 761 | private flushPendingChanges(): void { |
| 762 | if (this.pendingChanges.size === 0) return |
| 763 | |
| 764 | // If skipInitial and initial load isn't complete yet, discard |
| 765 | if (this.skipInitial && !this.initialLoadComplete) { |
| 766 | this.pendingChanges = new Map() |
| 767 | return |
| 768 | } |
| 769 | |
| 770 | const events: Array<DeltaEvent<TRow, TKey>> = [] |
| 771 | |
| 772 | for (const [key, changes] of this.pendingChanges) { |
| 773 | const event = classifyDelta<TRow, TKey>(key as TKey, changes) |
| 774 | if (event) { |
| 775 | events.push(event) |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | this.pendingChanges = new Map() |
| 780 | |
| 781 | if (events.length > 0) { |
| 782 | this.onBatchProcessed(events) |
| 783 | } |
| 784 | } |
| 785 | |
| 786 | /** Check if all source collections are in the ready state */ |
| 787 | private checkAllCollectionsReady(): boolean { |
no test coverage detected