pull/1864/head
Rich Harris 7 years ago
parent d5d854c51a
commit fba0f58226

@ -101,7 +101,13 @@ export class $$Component {
// we schedule onMount callbacks before afterRender callbacks
after_render(() => {
const onDestroy = this.$$onMount.map(run).filter(is_function);
if (this.$$onDestroy) {
this.$$onDestroy.push(...onDestroy);
} else {
// Edge case — component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(onDestroy);
}
this.$$onMount = [];
});

@ -15,7 +15,7 @@
<input type='number' bind:value={count}>
<ol>
{#each ids as object (object.id)}
{#each ids() as object (object.id)}
<Nested bind:value={idToValue[object.id]} id={object.id}>
{object.id}: value is {idToValue[object.id]}
</Nested>

Loading…
Cancel
Save