( callback: () => Promise<T> | T )
| 33 | * @returns The callback result. |
| 34 | */ |
| 35 | export async function runWithUndoRedoRecordingSuspended<T>( |
| 36 | callback: () => Promise<T> | T |
| 37 | ): Promise<T> { |
| 38 | recordingSuspendDepth += 1 |
| 39 | try { |
| 40 | return await Promise.resolve(callback()) |
| 41 | } finally { |
| 42 | recordingSuspendDepth = Math.max(0, recordingSuspendDepth - 1) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | function getStackKey(workflowId: string, userId: string): string { |
| 47 | return `${workflowId}:${userId}` |
no test coverage detected