-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add comment to explain nextTick/setImmediate
- Loading branch information
1 parent
9abeb51
commit 7b9bf35
Showing
2 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export const nextTick = (fn: () => unknown): void => { | ||
// simple implementation of window.setImmediate or NodeJS process.nextTick | ||
// used to execute user-provided callbacks asynchronously | ||
export const setImmediate = (fn: () => unknown): void => { | ||
setTimeout(fn, 0); | ||
}; |