Skip to content

withReentryGuard

withReentryGuard<T>(values, key, fn): Promise<T>

Defined in: packages/pubsub/src/context-values.ts:70

withReentryGuard runs a function while holding a boolean context key.

If the guard key is already set, the function still runs, but the helper does not modify the current guard state. This makes it safe to use in interceptors that may trigger nested calls. To carry the guard into a nested call, pass the same contextValues bag in that call’s options.

T

ContextValues

ContextKey<boolean>

() => T | Promise<T>

Promise<T>