blob: 3fa96cb61757343f1e7d4d1143fe57b9c479a561 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
//
// BlockCondition.swift
// Operations
//
// Created by pronebird on 25/09/2022.
// Copyright © 2026 Mullvad VPN AB. All rights reserved.
//
import Foundation
public final class BlockCondition: OperationCondition {
public typealias HandlerBlock = (Operation, @escaping (Bool) -> Void) -> Void
public var name: String {
"BlockCondition"
}
public var isMutuallyExclusive: Bool {
false
}
public let block: HandlerBlock
public init(block: @escaping HandlerBlock) {
self.block = block
}
public func evaluate(for operation: Operation, completion: @escaping (Bool) -> Void) {
block(operation, completion)
}
}
|