<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CKToolJS",
  "identifier" : "/documentation/CKToolJS/CancellablePromise/finally",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CKTool JS"
    ],
    "preciseIdentifier" : "instm/CancellablePromise/finally"
  },
  "title" : "finally"
}
-->

# finally

Tells `CancellablePromise` what callback to call when the inner promise either succeeds or fails.

```
CancellablePromise finally(
	Function? onfinally
);
```

## Parameters

`onfinally`

An optional function `CancellablePromise` calls when the inner promise succeeds or fails.

## Discussion

If you provide a function for the `onfinally` parameter, `CancellablePromise` calls that function after the promise succeeds or fails.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)