Skip to content

Commit 513b2ae

Browse files
committed
update comments to nextTick defer function
1 parent 577fe08 commit 513b2ae

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/util/env.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ var inBrowser = exports.inBrowser =
1818
toString.call(window) !== '[object Object]'
1919

2020
/**
21-
* Defer a task to the start of the next event loop
21+
* Defer a task to execute it asynchronously. Ideally this
22+
* should be executed as a microtask, so we leverage
23+
* MutationObserver if it's available.
24+
*
25+
* If the user has included a setImmediate polyfill, we can
26+
* also use that. In Node we actually prefer setImmediate to
27+
* process.nextTick so we don't block the I/O.
28+
*
29+
* Finally, fallback to setTimeout(0) if nothing else works.
2230
*
2331
* @param {Function} cb
2432
* @param {Object} ctx

0 commit comments

Comments
 (0)