Last active
August 14, 2019 17:03
-
-
Save Tevinthuku/f0fabdf851f100709a42e193c580af12 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
const CLASS_COMPONENT = "class"; | |
// ...code | |
export function scheduleUpdate(instance, partialState) { | |
workQueue.push({ | |
from: CLASS_COMPONENT, // we know scheduleUpdate came from a class so we have CLASS_COMPONENT here. | |
instance: instance, // *this* object | |
partialState: partialState // this represents the state that needs to be changed | |
}); | |
requestIdleCallback(performWork); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment