diff --git a/src/utils/sync_or_async.ts b/src/utils/sync_or_async.ts index 856570e454..c0e0ab123d 100644 --- a/src/utils/sync_or_async.ts +++ b/src/utils/sync_or_async.ts @@ -78,12 +78,14 @@ const SyncOrAsync = { * @returns {Object} */ createAsync(val: Promise): ISyncOrAsyncValue { - let ret = null; - val.then((resolved) => { + let ret: T | null = null; + val.then((resolved: T) => { ret = resolved; }, noop); return { - syncValue: ret, + get syncValue(): T | null { + return ret; + }, getValueAsAsync() { return val; },