Skip to content

addSkip

utils
Source Code | Documentation

See also: hooks/skippable

Adds hook names to context.params.skipHooks so that skippable-wrapped hooks will be bypassed for the current service call. Accepts a single name or an array. Duplicates are automatically removed.

ts
  import { 
addSkip
} from 'feathers-utils/utils';

Example

ts
import { addSkip } from 'feathers-utils/utils'

// Inside a hook or custom code:
addSkip(context, 'myHook')
addSkip(context, ['hookA', 'hookB'])

Type declaration

Show Type Declarations
ts
export type SkipHookName =
  | "all"
  | HookType
  | `${HookType}:${string}`
  | (string & {})
/**
 * Adds hook names to `context.params.skipHooks` so that `skippable`-wrapped hooks
 * will be bypassed for the current service call. Accepts a single name or an array.
 * Duplicates are automatically removed.
 *
 * @example
 * ```ts
 *
 *
 * // Inside a hook or custom code:
 * addSkip(context, 'myHook')
 * addSkip(context, ['hookA', 'hookB'])
 * ```
 *
 * @see https://utils.feathersjs.com/utils/add-skip.html
 */
export declare const addSkip: <H extends HookContext>(
  context: H,
  hooks: MaybeArray<SkipHookName>,
) => void
ArgumentTypeDescription
contextH
hooksMaybeArray<SkipHookName>

Released under the MIT License.