(state: Effect.Transaction["Service"], self: TxRef<A>)
| 156 | }) |
| 157 | |
| 158 | const journalEntry = <A>(state: Effect.Transaction["Service"], self: TxRef<A>) => { |
| 159 | const journal = (state as TransactionMetaInner).journal |
| 160 | let entry = journal.get(self) |
| 161 | if (entry === undefined) { |
| 162 | entry = { version: self.version, value: self.value, written: false } |
| 163 | journal.set(self, entry) |
| 164 | } |
| 165 | return entry |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * Modifies the value of the `TxRef` using the provided function. |