* Gets the origin of the last confirmed change to a row. * Returns 'local' if the row has optimistic mutations (optimistic changes are local). * Used to compute the $origin virtual property.
(key: TKey)
| 170 | * Used to compute the $origin virtual property. |
| 171 | */ |
| 172 | public getRowOrigin(key: TKey): VirtualOrigin { |
| 173 | if (this.isLocalOnly) { |
| 174 | return 'local' |
| 175 | } |
| 176 | // If there are optimistic changes, they're local |
| 177 | if (this.optimisticUpserts.has(key) || this.optimisticDeletes.has(key)) { |
| 178 | return 'local' |
| 179 | } |
| 180 | // Otherwise, return the confirmed origin (defaults to 'remote' for synced data) |
| 181 | return this.rowOrigins.get(key) ?? 'remote' |
| 182 | } |
| 183 | |
| 184 | private createVirtualPropsSnapshot( |
| 185 | key: TKey, |
no test coverage detected