Adds interface for fetchUpdateAsync() params

This commit is contained in:
Mikel Arnaiz
2018-09-25 10:47:27 +02:00
parent fbf888379b
commit c047c3cfcd
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -834,7 +834,7 @@ async () => {
console.log(updateCheckResult.manifest);
}
Updates.fetchUpdateAsync(updateEventListener);
Updates.fetchUpdateAsync({ eventListener: updateEventListener });
const bundleFetchResult = await Updates.fetchUpdateAsync();
+6 -1
View File
@@ -2915,6 +2915,11 @@ export namespace Updates {
message?: string;
}
/** An optional params object passed to fetchUpdateAsync. */
interface FetchUpdateAsyncParams {
eventListener: UpdateEventListener;
}
type UpdateEventListener = (event: UpdateEvent) => any;
/**
@@ -2934,7 +2939,7 @@ export namespace Updates {
* Downloads the most recent published version of your experience to the device's local cache.
* Rejects if `updates.enabled` is `false` in app.json.
*/
function fetchUpdateAsync(listener?: UpdateEventListener): Promise<UpdateBundle>;
function fetchUpdateAsync(params?: FetchUpdateAsyncParams): Promise<UpdateBundle>;
/**
* Immediately reloads the current experience.