Skip to content

Commit 93edf26

Browse files
vaibhav raivaibhav rai
vaibhav rai
authored and
vaibhav rai
committed
Address initial review
1 parent 7891d4b commit 93edf26

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/runtime/internal/scheduler.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function add_flush_callback(fn) {
3333

3434
let flushing = false;
3535
const seen_callbacks = new Set();
36-
let dirty_binding_component_map = new Map();
36+
let previous_dirty_components = [];
3737

3838
export function flush() {
3939
if (flushing) return;
@@ -45,19 +45,18 @@ export function flush() {
4545
for (let i = 0; i < dirty_components.length; i += 1) {
4646
const component = dirty_components[i];
4747
set_current_component(component);
48-
const is_dirty_from_binding = dirty_binding_component_map.has(component.constructor.name);
48+
const is_dirty_from_binding = previous_dirty_components.indexOf(component) > -1;
4949
update(component.$$, is_dirty_from_binding);
5050
}
51-
dirty_binding_component_map = new Map();
51+
previous_dirty_components = [];
5252
set_current_component(null);
5353

5454
dirty_components.length = 0;
5555

5656
while (binding_callbacks.length) {
5757
binding_callbacks.pop()();
5858
}
59-
dirty_components.forEach((i) =>
60-
dirty_binding_component_map.set(i.constructor.name, i));
59+
previous_dirty_components = [...dirty_components]
6160
// then, once components are updated, call
6261
// afterUpdate functions. This may cause
6362
// subsequent updates...

0 commit comments

Comments
 (0)