1. export type Thenable<T, R> = {
    2. then(resolve: (T) => mixed, reject: (mixed) => mixed): R,
    3. };
    4. // 接收一个可以返回 .then 函数的对象的函数(Promise,或者 like Promise)
    5. export function lazy<T, R>(ctor: () => Thenable<T, R>): LazyComponent<T> {
    6. // Lazy 类型的 React 元素
    7. return {
    8. $$typeof: REACT_LAZY_TYPE,
    9. // 可以返回 .then 函数的对象的函数(Promise,或者 like Promise)
    10. _ctor: ctor,
    11. // React uses these fields to store the result.
    12. // -1: 是未请求组件的状态
    13. // 0: Pending
    14. // 1: Resolved
    15. // 2: Rejected
    16. _status: -1,
    17. // 返回的结果
    18. _result: null,
    19. };
    20. }