Skip to content

driveWhileHolding

driveWhileHolding<T>(input, codes, fn): Promise<T>

Defined in: internal/driveSupport.ts:48

Holds codes for the duration of fn, then restores what was held before — including when fn throws — and resolves with whatever fn returned. A code already down on entry is left alone on both ends, so nesting composes: an inner call that repeats one of the outer call’s codes does not drop it when it returns.

T

DriveHoldInput

readonly string[]

() => Promise<T>

Promise<T>