MCPcopy
hub / github.com/vuejs/core / callHook

Function callHook

packages/runtime-dom/src/components/Transition.ts:96–105  ·  view source on GitHub ↗
(
  hook: Function | Function[] | undefined,
  args: any[] = [],
)

Source from the content-addressed store, hash-verified

94 * with custom HOCs.
95 */
96const callHook = (
97 hook: Function | Function[] | undefined,
98 args: any[] = [],
99) => {
100 if (isArray(hook)) {
101 hook.forEach(h => h(...args))
102 } else if (hook) {
103 hook(...args)
104 }
105}
106
107/**
108 * Check if a hook expects a callback (2nd arg), which means the user

Callers 7

makeEnterHookFunction · 0.70
onBeforeEnterFunction · 0.70
onBeforeAppearFunction · 0.70
onLeaveFunction · 0.70
onEnterCancelledFunction · 0.70
onAppearCancelledFunction · 0.70
onLeaveCancelledFunction · 0.70

Calls 2

hFunction · 0.90
forEachMethod · 0.80

Tested by

no test coverage detected