veritatisdoloremque
Version:
Monorepo for the Firebase JavaScript SDK
29 lines (18 loc) • 1.03 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/storage-types](./storage-types.md) > [UploadTask](./storage-types.uploadtask.md) > [then](./storage-types.uploadtask.then.md)
## UploadTask.then() method
This object behaves like a Promise, and resolves with its snapshot data when the upload completes.
<b>Signature:</b>
```typescript
then(
onFulfilled?: ((snapshot: UploadTaskSnapshot) => any) | null,
onRejected?: ((error: FirebaseStorageError) => any) | null
): Promise<any>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| onFulfilled | ((snapshot: [UploadTaskSnapshot](./storage-types.uploadtasksnapshot.md)<!-- -->) => any) \| null | The fulfillment callback. Promise chaining works as normal. |
| onRejected | ((error: [FirebaseStorageError](./storage-types.firebasestorageerror.md)<!-- -->) => any) \| null | The rejection callback. |
<b>Returns:</b>
Promise<any>