shouldSkip
See also: hooks/skippable utils/addSkip
Returns a predicate that checks params.skipHooks to determine if a hook should be skipped. Matches by hook name, hook type (e.g. 'before'), prefixed name (e.g. 'before:myHook'), or 'all' to skip everything. Designed to be used with skippable and addSkip.
import { shouldSkip } from 'feathers-utils/predicates';Example
import { skippable, shouldSkip } from 'feathers-utils/predicates'
const myHook = skippable(actualHook(), shouldSkip('myHook'))Hooks for predicates
| Hook | Description |
|---|---|
iff | 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 | 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 | Wraps a hook so it can be conditionally skipped based on a predicate.
When the predicate returns |
throwIf | Throws a |
unless | Executes a series of hooks when the predicate is falsy --- the inverse of |
Type declaration
Show Type Declarations
/**
* Returns a predicate that checks `params.skipHooks` to determine if a hook should be skipped.
* Matches by hook name, hook type (e.g. `'before'`), prefixed name (e.g. `'before:myHook'`),
* or `'all'` to skip everything. Designed to be used with `skippable` and `addSkip`.
*
* @example
* ```ts
*
*
* const myHook = skippable(actualHook(), shouldSkip('myHook'))
* ```
*
* @see https://utils.feathersjs.com/predicates/should-skip.html
*/
export declare const shouldSkip: <H extends HookContext = HookContext>(
hookName: SkipHookName,
) => (context: H) => boolean| Argument | Type | Description |
|---|---|---|
| hookName | SkipHookName |
