Skip to content

Commit e3d98b7

Browse files
committed
refactor: cleanup genEffects
1 parent 55517a1 commit e3d98b7

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

packages/compiler-vapor/src/generate.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
CodegenOptions as BaseCodegenOptions,
33
BaseCodegenResult,
44
} from '@vue/compiler-dom'
5-
import type { BlockIRNode, IREffect, RootIRNode, VaporHelper } from './ir'
5+
import type { BlockIRNode, RootIRNode, VaporHelper } from './ir'
66
import { extend, remove } from '@vue/shared'
77
import { genBlockContent } from './generators/block'
88
import { genTemplates } from './generators/template'
@@ -38,10 +38,6 @@ export class CodegenContext {
3838
identifiers: Record<string, string[]> = Object.create(null)
3939

4040
block: BlockIRNode
41-
genEffects: Array<
42-
(effects: IREffect[], context: CodegenContext) => CodeFragment[]
43-
> = []
44-
4541
withId<T>(fn: () => T, map: Record<string, string | null>): T {
4642
const { identifiers } = this
4743
const ids = Object.keys(map)

packages/compiler-vapor/src/generators/block.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ export function genBlockContent(
5353
}
5454

5555
push(...genOperations(operation, context))
56-
push(
57-
...(context.genEffects.length
58-
? context.genEffects[context.genEffects.length - 1]
59-
: genEffects)(effect, context),
60-
)
56+
push(...genEffects(effect, context))
6157

6258
push(NEWLINE, `return `)
6359

0 commit comments

Comments
 (0)