Skip to content

Commit f7d4994

Browse files
committed
tidy up
1 parent a72a6ca commit f7d4994

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/generators/Generator.ts

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import wrapModule from './wrapModule';
1313
import annotateWithScopes, { Scope } from '../utils/annotateWithScopes';
1414
import getName from '../utils/getName';
1515
import clone from '../utils/clone';
16-
import DomBlock from './dom/Block';
17-
import SsrBlock from './server-side-rendering/Block';
1816
import Stylesheet from '../css/Stylesheet';
1917
import { test } from '../config';
2018
import nodes from './nodes/index';

src/generators/dom/Block.ts

+4-11
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ export default class Block {
134134
this.builders.create.addLine(`${name} = ${renderStatement};`);
135135
this.builders.claim.addLine(`${name} = ${claimStatement};`);
136136

137-
this.mount(name, parentNode);
138-
139-
if (!parentNode) {
137+
if (parentNode) {
138+
this.builders.mount.addLine(`@appendNode(${name}, ${parentNode});`);
139+
} else {
140+
this.builders.mount.addLine(`@insertNode(${name}, #target, anchor);`);
140141
this.builders.unmount.addLine(`@detachNode(${name});`);
141142
}
142143
}
@@ -167,14 +168,6 @@ export default class Block {
167168
return this.generator.contextualise(this.contexts, this.indexes, expression, context, isEventHandler);
168169
}
169170

170-
mount(name: string, parentNode: string) {
171-
if (parentNode) {
172-
this.builders.mount.addLine(`@appendNode(${name}, ${parentNode});`);
173-
} else {
174-
this.builders.mount.addLine(`@insertNode(${name}, #target, anchor);`);
175-
}
176-
}
177-
178171
toString() {
179172
let introing;
180173
const hasIntros = !this.builders.intro.isEmpty();

0 commit comments

Comments
 (0)