From 0414ee69c44c1483034e69cc39acd464940cb14c Mon Sep 17 00:00:00 2001 From: Ivan Hofer Date: Sun, 27 Jun 2021 15:50:59 +0200 Subject: [PATCH] test another append_styles approach --- src/runtime/internal/Component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runtime/internal/Component.ts b/src/runtime/internal/Component.ts index e706928af3..65440c52cb 100644 --- a/src/runtime/internal/Component.ts +++ b/src/runtime/internal/Component.ts @@ -104,7 +104,15 @@ function make_dirty(component, i) { component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); } -export function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) { +let append_styles; +export function set_append_styles(append_styles_fn) { + append_styles = function (root) { + append_styles_fn(root); + append_styles = null; + }; +} + +export function init(component, options, instance, create_fragment, not_equal, props, _append_styles_legacy, dirty = [-1]) { const parent_component = current_component; set_current_component(component);