## ReadablePromise.finally() method [​](/content/docs/sdk/core.readablepromise.finally#readablepromisefinally-method "Direct link to ReadablePromise.finally(/index.html) method")

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

**Signature:**

```typescript
finally(onfinally?: (() => void) | null): Promise<T>;
```

## Parameters [​](/content/docs/sdk/core.readablepromise.finally#parameters "Direct link to Parameters"/index.html)

| Parameter | Type | Description |
| --- | --- | --- |
| onfinally | (() => void) | null | _(Optional)_ The callback to execute when the Promise is settled (fulfilled or rejected). |

**Returns:**

Promise<T>

A Promise for the completion of the callback.

- [ReadablePromise.finally() method](/content/docs/sdk/core.readablepromise.finally#readablepromisefinally-method/index.html)
- [Parameters](/content/docs/sdk/core.readablepromise.finally#parameters/index.html)
