Prechádzať zdrojové kódy

Update PriorityQueue.js

Garrett Johnson 4 rokov pred
rodič
commit
dbd518d14b
1 zmenil súbory, kde vykonal 1 pridanie a 8 odobranie
  1. 1 8
      src/utilities/PriorityQueue.js

+ 1 - 8
src/utilities/PriorityQueue.js

@@ -1,10 +1,3 @@
-// Fires at the end of the frame and before the next one
-function enqueueMicrotask( callback ) {
-
-	Promise.resolve().then( callback );
-
-}
-
 class PriorityQueue {
 class PriorityQueue {
 
 
 	constructor() {
 	constructor() {
@@ -121,7 +114,7 @@ class PriorityQueue {
 
 
 		if ( ! this.scheduled ) {
 		if ( ! this.scheduled ) {
 
 
-			enqueueMicrotask( () => {
+			requestAnimationFrame( () => {
 
 
 				this.tryRunJobs();
 				this.tryRunJobs();
 				this.scheduled = false;
 				this.scheduled = false;