Created
July 30, 2019 04:13
-
-
Save jmuzsik/864e20b0f22cde27bd463edc188505c1 to your computer and use it in GitHub Desktop.
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
// Adds to task queue. | |
enqueueTask(taskHandler, taskData) { | |
this.taskList.push({ | |
// taskHandler is this.logTaskHandler | |
handler: taskHandler, | |
/* | |
An object as so: | |
{ | |
count: 104, | |
text: "This text is from task number 90 of 100" | |
} | |
*/ | |
data: taskData | |
}); | |
// Keep track of length of list | |
this.totalTaskCount++; | |
// It is only null when the component first renders | |
if (!this.taskHandle) { | |
this.taskHandle = requestIdleCallback(this.runTaskQueue); | |
} | |
this.scheduleStatusRefresh(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment