-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
406c750
commit dad9d0f
Showing
8 changed files
with
51 additions
and
75 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export enum SchedulerJobFlags { | ||
QUEUED = 1 << 0, | ||
PRE = 1 << 1, | ||
/** | ||
* Indicates whether the effect is allowed to recursively trigger itself | ||
* when managed by the scheduler. | ||
* | ||
* By default, a job cannot trigger itself because some built-in method calls, | ||
* e.g. Array.prototype.push actually performs reads as well (#1740) which | ||
* can lead to confusing infinite loops. | ||
* The allowed cases are component update functions and watch callbacks. | ||
* Component update functions may update child component props, which in turn | ||
* trigger flush: "pre" watch callbacks that mutates state that the parent | ||
* relies on (#1801). Watch callbacks doesn't track its dependencies so if it | ||
* triggers itself again, it's likely intentional and it is the user's | ||
* responsibility to perform recursive state mutation that eventually | ||
* stabilizes (#1727). | ||
*/ | ||
ALLOW_RECURSE = 1 << 2, | ||
DISPOSED = 1 << 3, | ||
} | ||
|
||
export interface SchedulerJob extends Function { | ||
id?: number | ||
/** | ||
* flags can technically be undefined, but it can still be used in bitwise | ||
* operations just like 0. | ||
*/ | ||
flags?: SchedulerJobFlags | ||
} |
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
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