Skip to content

Commit

Permalink
if (!remount) dispose =
Browse files Browse the repository at this point in the history
  • Loading branch information
pushkine committed May 7, 2020
1 parent 6cd0921 commit 3c8b618
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/compiler/compile/render_dom/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,23 +460,13 @@ export default class Block {
this.add_variable(dispose);

if (this.event_listeners.length === 1) {
this.chunks.mount.push(
b`
if (#remount) ${dispose}();
${dispose} = ${this.event_listeners[0]};
`
);
this.chunks.mount.push(b`if (!#remount) ${dispose} = ${this.event_listeners[0]};`);

this.chunks.destroy.push(
b`${dispose}();`
);
} else {
this.chunks.mount.push(b`
if (#remount) @run_all(${dispose});
${dispose} = [
${this.event_listeners}
];
`);
this.chunks.mount.push(b`if (!#remount) ${dispose} = [ ${this.event_listeners} ];`);

this.chunks.destroy.push(
b`@run_all(${dispose});`
Expand Down

0 comments on commit 3c8b618

Please sign in to comment.