control-flow
Decides whether or in which order other hooks run, rather than touching the call itself.
| Name | Category | Description |
|---|---|---|
combine | hooks | Sequentially executes multiple hooks, passing the updated context from one to the next. Returns a single hook function that runs the entire chain. If any hook throws, the error is annotated with the current hook context. |
iff | hooks | Conditionally executes a series of hooks when the predicate is truthy.
The predicate can be a boolean value or a sync/async function.
Supports an |
iffElse | hooks | Executes one array of hooks when the predicate is truthy, or another array when it is falsy.
The predicate can be a boolean or a sync/async function.
Unlike |
skippable | hooks | Wraps a hook so it can be conditionally skipped based on a predicate.
When the predicate returns |
throwIf | hooks | Throws a |
unless | hooks | Executes a series of hooks when the predicate is falsy --- the inverse of |
addSkip | utils | Adds hook names to |
defineHooks | utils | TypeScript helper that provides full type inference and autocompletion when defining service hooks. It is an identity function that simply returns its input, but enables your IDE to infer the correct hook context types. |
fromPredicate | resolvers | Adapts an existing predicate function (like |
and | predicates | Returns a predicate that is |
isContext | predicates | Returns a predicate that checks whether the hook context matches the given criteria.
You can filter by |
not | predicates | Negates a sync or async predicate function, inverting its boolean result. Useful for composing conditions like "not external" or "not multi". |
or | predicates | Returns a predicate that is |
shouldSkip | predicates | Returns a predicate that checks |
See all tags for the full vocabulary.
