Skip to content

Commit 09f8aa6

Browse files
committed
Added isFlushing.
1 parent 81f06af commit 09f8aa6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/core/global-api/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from '../util/index'
1919

2020
import Dep, { pushTarget, popTarget } from '../observer/dep'
21-
import { afterFlush, forceFlush } from '../observer/scheduler'
21+
import { afterFlush, forceFlush, isFlushing } from '../observer/scheduler'
2222
import Watcher from '../observer/watcher'
2323

2424
export function initGlobalAPI (Vue: GlobalAPI) {
@@ -51,6 +51,7 @@ export function initGlobalAPI (Vue: GlobalAPI) {
5151
popTarget,
5252
afterFlush,
5353
forceFlush,
54+
isFlushing,
5455
Watcher
5556
}
5657

src/core/observer/scheduler.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ export function forceFlush (maxUpdateCount?: number) {
212212
flushSchedulerQueue(maxUpdateCount)
213213
}
214214

215+
/**
216+
* Are we inside a flush?
217+
*/
218+
export function isFlushing () {
219+
return flushing;
220+
}
221+
215222
/**
216223
* Used in watchers to wrap provided getters to set scheduler flags.
217224
*/

0 commit comments

Comments
 (0)