(lifecycle: LifecycleHooks)
| 65 | |
| 66 | const createHook = |
| 67 | <T extends Function = () => any>(lifecycle: LifecycleHooks) => |
| 68 | ( |
| 69 | hook: T, |
| 70 | target: ComponentInternalInstance | null = currentInstance, |
| 71 | ): void => { |
| 72 | // post-create lifecycle registrations are noops during SSR (except for serverPrefetch) |
| 73 | if ( |
| 74 | !isInSSRComponentSetup || |
| 75 | lifecycle === LifecycleHooks.SERVER_PREFETCH |
| 76 | ) { |
| 77 | injectHook(lifecycle, (...args: unknown[]) => hook(...args), target) |
| 78 | } |
| 79 | } |
| 80 | type CreateHook<T = any> = ( |
| 81 | hook: T, |
| 82 | target?: ComponentInternalInstance | null, |
no test coverage detected