---
title: "init(_:)"
framework: combine
role: symbol
role_heading: Initializer
path: "combine/anycancellable/init(_:)-3icn3"
---

# init(_:)

Initializes the cancellable object with the given cancel-time closure.

## Declaration

```swift
init(_ cancel: @escaping () -> Void)
```

## Parameters

- `cancel`: A closure that the cancel() method executes.

## See Also

### Creating a type-erased cancellable

- [init(_:)](combine/anycancellable/init(_:)-48fh3.md)
