From 85dacdbedbe6fa95f87d1d6ce2e58737d1f4b45c Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sun, 18 Nov 2018 22:39:20 -0500 Subject: [PATCH] put intro stuff on scheduler, not root --- src/internal/SvelteComponent.js | 6 +++--- src/internal/scheduler.js | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/internal/SvelteComponent.js b/src/internal/SvelteComponent.js index 5ea8d0ea1e..d0cc97789e 100644 --- a/src/internal/SvelteComponent.js +++ b/src/internal/SvelteComponent.js @@ -1,4 +1,4 @@ -import { schedule_update, flush } from './scheduler.js'; +import { schedule_update, flush, intro } from './scheduler.js'; import { set_current_component } from './lifecycle.js' import { run_all } from './utils.js'; import { blankObject } from './utils.js'; @@ -35,10 +35,10 @@ export class SvelteComponent { this.$$fragment = this.$$create_fragment(this, this.$$.get_state()); if (options.target) { - this.$$intro = false; // TODO can we put this in the scheduler instead? + intro.enabled = false; this.$$mount(options.target); flush(); - this.$$intro = true; + intro.enabled = true; } } diff --git a/src/internal/scheduler.js b/src/internal/scheduler.js index dd292c6790..e2646d2755 100644 --- a/src/internal/scheduler.js +++ b/src/internal/scheduler.js @@ -3,6 +3,8 @@ let update_scheduled = false; const dirty_components = []; const after_update_callbacks = []; +export const intro = { enabled: false }; + export function schedule_update(component) { dirty_components.push(component); if (!update_scheduled) {