From 3c8b618ecdff7a964b833245611083c5f9c1dd65 Mon Sep 17 00:00:00 2001 From: pushkine Date: Thu, 7 May 2020 05:52:08 +0200 Subject: [PATCH] if (!remount) dispose = --- src/compiler/compile/render_dom/Block.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/compiler/compile/render_dom/Block.ts b/src/compiler/compile/render_dom/Block.ts index e93ae134acea..ba193c4d7085 100644 --- a/src/compiler/compile/render_dom/Block.ts +++ b/src/compiler/compile/render_dom/Block.ts @@ -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});`