Insure if_block dependency is dirty to update

Fixes #4630, summary of #4620, #4064, #3685, #3410 and #3202.

prior to this change, a component would simply cancel the outro of its `if_block` for any update happening between `outrostart` and `outroend`

I tested the REPL provided on each issue and they're all fixed, all but #4064 that also has another bug I'll be looking into
pull/4699/head
pushkin 6 years ago committed by GitHub
parent aa3dcc06d6
commit 96537a7057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -520,25 +520,14 @@ export default class IfBlockWrapper extends Wrapper {
if (branch.dependencies.length > 0) {
const update_mount_node = this.get_update_mount_node(anchor);
const enter = dynamic
? b`
if (${name}) {
${name}.p(#ctx, #dirty);
${has_transitions && b`@transition_in(${name}, 1);`}
} else {
${name} = ${branch.block.name}(#ctx);
${name}.c();
${has_transitions && b`@transition_in(${name}, 1);`}
${name}.m(${update_mount_node}, ${anchor});
}
`
: b`
const enter = b`
if (!${name}) {
${name} = ${branch.block.name}(#ctx);
${name}.c();
${has_transitions && b`@transition_in(${name}, 1);`}
${name}.m(${update_mount_node}, ${anchor});
} else {
} else if (${block.renderer.dirty(branch.dependencies)}) {
${dynamic && b`${name}.p(#ctx, #dirty);`}
${has_transitions && b`@transition_in(${name}, 1);`}
}
`;

Loading…
Cancel
Save