refactor: remove null comparisons
This commit is contained in:
@@ -85,7 +85,7 @@ const KeepAliveImpl = {
|
||||
queuePostRenderEffect(() => {
|
||||
const component = vnode.component!
|
||||
component.isDeactivated = false
|
||||
if (component.a !== null) {
|
||||
if (component.a) {
|
||||
invokeHooks(component.a)
|
||||
}
|
||||
}, parentSuspense)
|
||||
@@ -95,7 +95,7 @@ const KeepAliveImpl = {
|
||||
move(vnode, storageContainer, null, MoveType.LEAVE, parentSuspense)
|
||||
queuePostRenderEffect(() => {
|
||||
const component = vnode.component!
|
||||
if (component.da !== null) {
|
||||
if (component.da) {
|
||||
invokeHooks(component.da)
|
||||
}
|
||||
component.isDeactivated = true
|
||||
|
||||
@@ -44,7 +44,7 @@ export const PortalImpl = {
|
||||
const target = (n2.target = isString(targetSelector)
|
||||
? querySelector!(targetSelector)
|
||||
: targetSelector)
|
||||
if (target != null) {
|
||||
if (target) {
|
||||
if (shapeFlag & ShapeFlags.TEXT_CHILDREN) {
|
||||
setElementText(target, children as string)
|
||||
} else if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
|
||||
@@ -93,7 +93,7 @@ export const PortalImpl = {
|
||||
const nextTarget = (n2.target = isString(targetSelector)
|
||||
? querySelector!(targetSelector)
|
||||
: targetSelector)
|
||||
if (nextTarget != null) {
|
||||
if (nextTarget) {
|
||||
// move content
|
||||
if (shapeFlag & ShapeFlags.TEXT_CHILDREN) {
|
||||
setElementText(target, '')
|
||||
|
||||
@@ -536,7 +536,7 @@ export function queueEffectWithSuspense(
|
||||
fn: Function | Function[],
|
||||
suspense: SuspenseBoundary | null
|
||||
): void {
|
||||
if (suspense !== null && !suspense.isResolved) {
|
||||
if (suspense && !suspense.isResolved) {
|
||||
if (isArray(fn)) {
|
||||
suspense.effects.push(...fn)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user