* Get all keys (virtual derived state)
()
| 387 | * Get all keys (virtual derived state) |
| 388 | */ |
| 389 | public *keys(): IterableIterator<TKey> { |
| 390 | const { syncedData, optimisticDeletes, optimisticUpserts } = this |
| 391 | // Yield keys from synced data, skipping any that are deleted. |
| 392 | for (const key of syncedData.keys()) { |
| 393 | if (!optimisticDeletes.has(key)) { |
| 394 | yield key |
| 395 | } |
| 396 | } |
| 397 | // Yield keys from upserts that were not already in synced data. |
| 398 | for (const key of optimisticUpserts.keys()) { |
| 399 | if (!syncedData.has(key) && !optimisticDeletes.has(key)) { |
| 400 | // The optimisticDeletes check is technically redundant if inserts/updates always remove from deletes, |
| 401 | // but it's safer to keep it. |
| 402 | yield key |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | /** |
| 408 | * Get all values (virtual derived state) |
no test coverage detected