Move lazy._result assignment (#14632)

This commit is contained in:
Dan Abramov
2019-01-18 21:57:26 +00:00
committed by GitHub
parent 9120f6c2d8
commit a2fa6eb98d
+1 -1
View File
@@ -47,7 +47,6 @@ export function readLazyComponentType<T>(lazyComponent: LazyComponent<T>): T {
lazyComponent._status = Pending;
const ctor = lazyComponent._ctor;
const thenable = ctor();
lazyComponent._result = thenable;
thenable.then(
moduleObject => {
if (lazyComponent._status === Pending) {
@@ -78,6 +77,7 @@ export function readLazyComponentType<T>(lazyComponent: LazyComponent<T>): T {
if (lazyComponent._status === Resolved) {
return lazyComponent._result;
}
lazyComponent._result = thenable;
throw thenable;
}
}