( rows: Array<Partial<VirtualRowProps<string | number>>>, groupKey: TKey, collectionId: string, )
| 236 | * @internal |
| 237 | */ |
| 238 | export function computeAggregateVirtualProps<TKey extends string | number>( |
| 239 | rows: Array<Partial<VirtualRowProps<string | number>>>, |
| 240 | groupKey: TKey, |
| 241 | collectionId: string, |
| 242 | ): VirtualRowProps<TKey> { |
| 243 | // $synced = true only if ALL rows are synced (false if ANY is optimistic) |
| 244 | const allSynced = rows.every((row) => row.$synced ?? true) |
| 245 | |
| 246 | // $origin = 'local' if ANY row is local (consistent with "local influence" semantics) |
| 247 | const hasLocal = rows.some((row) => row.$origin === 'local') |
| 248 | |
| 249 | return { |
| 250 | $synced: allSynced, |
| 251 | $origin: hasLocal ? 'local' : 'remote', |
| 252 | $key: groupKey, |
| 253 | $collectionId: collectionId, |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * List of virtual property names for iteration and checking. |
nothing calls this directly
no outgoing calls
no test coverage detected