mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-01-15 21:53:29 +01:00
16 lines
305 B
Swift
Executable File
16 lines
305 B
Swift
Executable File
import Combine
|
|
|
|
final class AnySubscription: Subscription {
|
|
private let cancellable: Cancellable
|
|
|
|
init(_ cancel: @escaping () -> Void) {
|
|
cancellable = AnyCancellable(cancel)
|
|
}
|
|
|
|
func request(_ demand: Subscribers.Demand) {}
|
|
|
|
func cancel() {
|
|
cancellable.cancel()
|
|
}
|
|
}
|