Check if slotted component has an update function during runtime

pull/2128/head
Iván Sánchez Ortega 6 years ago
parent c494c05ebf
commit 295019f9e4

@ -141,7 +141,7 @@ export default class SlotWrapper extends Wrapper {
if (this.dependencies.size > 1) update_conditions = `(${update_conditions})`;
block.builders.update.addBlock(deindent`
if (${slot} && ${update_conditions}) {
if (${slot} && ${slot}.p && ${update_conditions}) {
${slot}.p(@assign(@assign({}, ${get_slot_changes}(changed)), ctx.$$scope.changed), @get_slot_context(${slot_definition}, ctx, ${get_slot_context}));
}
`);
@ -150,4 +150,4 @@ export default class SlotWrapper extends Wrapper {
`if (${slot}) ${slot}.d(detach);`
);
}
}
}

Loading…
Cancel
Save