diff --git a/index.js b/index.js index 97457f9..96106b3 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ } function get_current_component() { if (!current_component) - throw new Error(`Function called outside component initialization`); + throw new Error('Function called outside component initialization'); return current_component; } function beforeUpdate(fn) { @@ -112,6 +112,7 @@ set_current_component(component); update(component.$$); } + set_current_component(null); dirty_components.length = 0; while (binding_callbacks.length) binding_callbacks.pop()(); @@ -469,7 +470,7 @@ return result; }; - /* src/index.svelte generated by Svelte v3.24.1 */ + /* src/index.svelte generated by Svelte v3.29.4 */ function create_fragment(ctx) { let div; diff --git a/index.mjs b/index.mjs index d0091bc..a0bacc6 100644 --- a/index.mjs +++ b/index.mjs @@ -47,7 +47,7 @@ function set_current_component(component) { } function get_current_component() { if (!current_component) - throw new Error(`Function called outside component initialization`); + throw new Error('Function called outside component initialization'); return current_component; } function beforeUpdate(fn) { @@ -106,6 +106,7 @@ function flush() { set_current_component(component); update(component.$$); } + set_current_component(null); dirty_components.length = 0; while (binding_callbacks.length) binding_callbacks.pop()(); @@ -463,7 +464,7 @@ const ATOMIC_DATA_TYPE = ['string', 'number', 'function', 'boolean', 'undefined' return result; }; -/* src/index.svelte generated by Svelte v3.24.1 */ +/* src/index.svelte generated by Svelte v3.29.4 */ function create_fragment(ctx) { let div;