Skip to content

Commit 02c93d4

Browse files
committed
break another cycle
1 parent 4bd3563 commit 02c93d4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/@ember/-internals/metal/lib/observer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ENV } from '@ember/-internals/environment';
22
import { peekMeta } from '@ember/-internals/meta';
3-
import { schedule } from '@ember/runloop';
3+
import type { schedule } from '@ember/runloop';
44
import { registerDestructor } from '@glimmer/destroyable';
55
import type { Tag } from '@glimmer/validator';
66
import { CURRENT_TAG, tagMetaFor, validateTag, valueForTag } from '@glimmer/validator';
@@ -187,7 +187,7 @@ export function revalidateObservers(target: object) {
187187

188188
let lastKnownRevision = 0;
189189

190-
export function flushAsyncObservers(shouldSchedule = true) {
190+
export function flushAsyncObservers(_schedule: typeof schedule | false) {
191191
let currentRevision = valueForTag(CURRENT_TAG);
192192
if (lastKnownRevision === currentRevision) {
193193
return;
@@ -213,8 +213,8 @@ export function flushAsyncObservers(shouldSchedule = true) {
213213
}
214214
};
215215

216-
if (shouldSchedule) {
217-
schedule('actions', sendObserver);
216+
if (_schedule) {
217+
_schedule('actions', sendObserver);
218218
} else {
219219
sendObserver();
220220
}

packages/@ember/runloop/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ function onBegin(current: DeferredActionQueues) {
4545
function onEnd(_current: DeferredActionQueues, next: DeferredActionQueues) {
4646
currentRunLoop = next;
4747

48-
flushAsyncObservers();
48+
flushAsyncObservers(schedule);
4949
}
5050

5151
function flush(queueName: string, next: () => void) {
5252
if (queueName === 'render' || queueName === _rsvpErrorQueue) {
53-
flushAsyncObservers();
53+
flushAsyncObservers(schedule);
5454
}
5555

5656
next();

0 commit comments

Comments
 (0)