(input: RecordEditInput)
| 156 | return { |
| 157 | snapshot: () => snapshotEditHistoryState(state), |
| 158 | async recordEdit(input: RecordEditInput) { |
| 159 | await mutate<void>(async (currentState) => { |
| 160 | const timestamp = now(); |
| 161 | const entry = buildEditHistoryEntry({ |
| 162 | ...input, |
| 163 | id: createEntryId(timestamp), |
| 164 | projectId, |
| 165 | now: timestamp, |
| 166 | }); |
| 167 | return { |
| 168 | state: pushEditHistoryEntry(currentState, entry), |
| 169 | result: undefined, |
| 170 | }; |
| 171 | }); |
| 172 | }, |
| 173 | async undo(callbacks: ApplyCallbacks): Promise<ApplyResult> { |
| 174 | return mutate<ApplyResult>(async (currentState) => { |
| 175 | const entry = currentState.undo[currentState.undo.length - 1]; |
no test coverage detected