* Get the current value for a key (virtual derived state)
(key: TKey)
| 349 | * Get the current value for a key (virtual derived state) |
| 350 | */ |
| 351 | public get(key: TKey): TOutput | undefined { |
| 352 | const { optimisticDeletes, optimisticUpserts, syncedData } = this |
| 353 | // Check if optimistically deleted |
| 354 | if (optimisticDeletes.has(key)) { |
| 355 | return undefined |
| 356 | } |
| 357 | |
| 358 | // Check optimistic upserts first |
| 359 | if (optimisticUpserts.has(key)) { |
| 360 | return optimisticUpserts.get(key) |
| 361 | } |
| 362 | |
| 363 | // Fall back to synced data |
| 364 | return syncedData.get(key) |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * Check if a key exists in the collection (virtual derived state) |
no test coverage detected