diff --git a/src/generators/dom/Block.ts b/src/generators/dom/Block.ts index f851727276..069fb7f2b8 100644 --- a/src/generators/dom/Block.ts +++ b/src/generators/dom/Block.ts @@ -195,7 +195,7 @@ export default class Block { let outroing; const hasOutros = !this.builders.outro.isEmpty(); if (hasOutros) { - outroing = this.getUniqueName('outroing'); + outroing = this.alias('outroing'); this.addVariable(outroing); } diff --git a/src/generators/dom/visitors/MustacheTag.ts b/src/generators/dom/visitors/MustacheTag.ts index 7be3a541d9..355e3b99fc 100644 --- a/src/generators/dom/visitors/MustacheTag.ts +++ b/src/generators/dom/visitors/MustacheTag.ts @@ -27,7 +27,10 @@ export default function visitMustacheTag( ); if (dependencies.length) { - const changedCheck = dependencies.map(dependency => `'${dependency}' in changed`).join(' || '); + const changedCheck = ( + ( block.hasOutroMethod ? `#outroing || ` : '' ) + + dependencies.map(dependency => `'${dependency}' in changed`).join(' || ') + ); block.builders.update.addBlock(deindent` if ( ( ${changedCheck} ) && ${value} !== ( ${value} = ${snippet} ) ) {