call outrocallback immediately for empty each block

pull/1533/head
Rich Harris 6 years ago
parent 7c0986fded
commit f8ca0d4efe

@ -15,6 +15,7 @@ export function isPromise(value) {
}
export function callAfter(fn, i) {
if (i === 0) fn();
return () => {
if (!--i) fn();
};

@ -0,0 +1,20 @@
export default {
data: {
visible: true,
empty: []
},
html: `
<div>
<p>text</p>
</div>
`,
nestedTransitions: true,
test(assert, component, target) {
component.set({ visible: false });
assert.htmlEqual(target.innerHTML, ``);
}
};

@ -0,0 +1,17 @@
{#if visible}
<div>
{#each empty as thing}
<Thing {thing}/>
{/each}
<p>text</p>
</div>
{/if}
<script>
export default {
components: {
Thing: './Thing.html'
}
};
</script>
Loading…
Cancel
Save