From 0449550800aa5fb150194de0f4e802ac8932bb79 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 26 Mar 2020 14:51:21 -0700 Subject: [PATCH] $$slots destroy --- src/runtime/internal/slots.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/runtime/internal/slots.ts b/src/runtime/internal/slots.ts index e457bb7b2f..150df203b9 100644 --- a/src/runtime/internal/slots.ts +++ b/src/runtime/internal/slots.ts @@ -69,7 +69,12 @@ export function create_slots_accessor(slots, scope) { scope, () => assign(ctx, props), () => Object.keys(props).reduce((o, k) => (o[k] = true, o), {}) - ) + ), + destroy: () => { + slot.d(); + const i = update_list.indexOf(local_update); + if (i !== -1) update_list.splice(i, 1); + } }; }; }