// // AutoCancellable.swift // AutoCat // // Created by Selim Mustafaev on 18.02.2025. // Copyright © 2025 Selim Mustafaev. All rights reserved. // import Foundation @propertyWrapper public struct AutoCancellable { public var wrappedValue: Task? { didSet { if let oldValue, oldValue.isCancelled { return } oldValue?.cancel() } } public init(wrappedValue: Task?) { self.wrappedValue = wrappedValue } }