mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
* [scheduler] Deadline object -> shouldYield Instead of using a requestIdleCallback-style deadline object, expose a method Scheduler.shouldYield that returns true if there's a higher priority event in the queue. * Nits
27 lines
555 B
JavaScript
27 lines
555 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import React from 'react';
|
|
|
|
const ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
|
|
const {
|
|
unstable_cancelCallback,
|
|
unstable_now,
|
|
unstable_scheduleCallback,
|
|
unstable_shouldYield,
|
|
} = ReactInternals.Scheduler;
|
|
|
|
export {
|
|
unstable_cancelCallback,
|
|
unstable_now,
|
|
unstable_scheduleCallback,
|
|
unstable_shouldYield,
|
|
};
|