expo-updates
Version:
Fetches and manages remotely-hosted assets and updates to your app's JS bundle.
27 lines • 1.02 kB
TypeScript
import { UpdateEvent } from './Updates.types';
/**
* React hook to create an [`UpdateEvent`](#updateevent) listener subscription on mount, using
* [`addListener`](#updatesaddlistenerlistener). It calls `remove()` on the subscription during unmount.
*
* @param listener A function that will be invoked with an [`UpdateEvent`](#updateevent) instance
* and should not return any value.
*
* @example
* ```ts
* function App() {
* const eventListener = (event) => {
* if (event.type === Updates.UpdateEventType.ERROR) {
* // Handle error
* } else if (event.type === Updates.UpdateEventType.NO_UPDATE_AVAILABLE) {
* // Handle no update available
* } else if (event.type === Updates.UpdateEventType.UPDATE_AVAILABLE) {
* // Handle update available
* }
* };
* Updates.useUpdateEvents(eventListener);
* // React Component...
* }
* ```
*/
export declare const useUpdateEvents: (listener: (event: UpdateEvent) => void) => void;
//# sourceMappingURL=UpdatesHooks.d.ts.map