From 91bd8412ae627df34f46869ecd9040f4c2246eca Mon Sep 17 00:00:00 2001 From: Devi Prasad Date: Sun, 28 Jul 2019 20:28:25 -0500 Subject: [PATCH] ensures sequential lifecycle ending in afterUpdate --- src/runtime/internal/scheduler.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/internal/scheduler.ts b/src/runtime/internal/scheduler.ts index e3d7181fcb..7c9c7d007e 100644 --- a/src/runtime/internal/scheduler.ts +++ b/src/runtime/internal/scheduler.ts @@ -35,6 +35,9 @@ export function flush() { const seen_callbacks = new Set(); do { + // invalidate bindings before checking dirty_components + while (binding_callbacks.length) binding_callbacks.pop()(); + // first, call beforeUpdate functions // and update components while (dirty_components.length) { @@ -43,8 +46,6 @@ export function flush() { update(component.$$); } - while (binding_callbacks.length) binding_callbacks.pop()(); - // then, once components are updated, call // afterUpdate functions. This may cause // subsequent updates...