* Get the previous value for a key given previous optimistic state
(
key: TKey,
previousUpserts: Map<TKey, TOutput>,
previousDeletes: Set<TKey>,
)
| 797 | * Get the previous value for a key given previous optimistic state |
| 798 | */ |
| 799 | private getPreviousValue( |
| 800 | key: TKey, |
| 801 | previousUpserts: Map<TKey, TOutput>, |
| 802 | previousDeletes: Set<TKey>, |
| 803 | ): TOutput | undefined { |
| 804 | if (previousDeletes.has(key)) { |
| 805 | return undefined |
| 806 | } |
| 807 | if (previousUpserts.has(key)) { |
| 808 | return previousUpserts.get(key) |
| 809 | } |
| 810 | return this.syncedData.get(key) |
| 811 | } |
| 812 | |
| 813 | /** |
| 814 | * Attempts to commit pending synced transactions if there are no active transactions |
no test coverage detected