Skip to content

Commit

Permalink
chore: use if instead of &&
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Skyblue committed Oct 25, 2023
1 parent 00a2e89 commit c10a02e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/runtime-core/src/apiLifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ export const createHook =
<T extends Function = () => any>(lifecycle: LifecycleHooks) =>
(hook: T, target: ComponentInternalInstance | null = currentInstance) => {
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
;(!isInSSRComponentSetup || lifecycle === LifecycleHooks.SERVER_PREFETCH) &&
if (
!isInSSRComponentSetup ||
lifecycle === LifecycleHooks.SERVER_PREFETCH
) {
injectHook(lifecycle, (...args: unknown[]) => hook(...args), target)
}
}

export const onBeforeMount = createHook(LifecycleHooks.BEFORE_MOUNT)
Expand Down

0 comments on commit c10a02e

Please sign in to comment.