Add config to enable sync scheduling by default

I'll turn this on in ReactDOMFiber once I figure out batchedUpdates.
This commit is contained in:
Andrew Clark committed 2016-11-02 12:40:20 -07:00
1 parent 7b9ae92058
commit 78aef38bfa
2 files changed
+6 -2

No files matched your search

@@ -56,8 +56,9 @@ export type HostConfig<T, P, I, TI, C> = {
removeChild(parentInstance : I, child : I | TI) : void,
scheduleAnimationCallback(callback : () => void) : void,
scheduleDeferredCallback(callback : (deadline : Deadline) => void) : void
scheduleDeferredCallback(callback : (deadline : Deadline) => void) : void,
useSyncScheduling ?: boolean,
};
type OpaqueNode = Fiber;
@@ -62,11 +62,14 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
const scheduleAnimationCallback = config.scheduleAnimationCallback;
const scheduleDeferredCallback = config.scheduleDeferredCallback;
const useSyncScheduling = config.useSyncScheduling;
// The priority level to use when scheduling an update.
let priorityContext : (PriorityLevel | null) = null;
// The priority level to use if there is no priority context.
let defaultPriorityContext : PriorityLevel = LowPriority;
let defaultPriorityContext : PriorityLevel = useSyncScheduling ?
SynchronousPriority :
LowPriority;
// The next work in progress fiber that we're currently working on.
let nextUnitOfWork : ?Fiber = null;