This commit is contained in:
Михаил Капелько
2023-12-28 13:33:20 +03:00
parent a1ec08f280
commit 16026a7b47
21 changed files with 26 additions and 16 deletions

30
Modules/BusX/src/unused Normal file
View File

@@ -0,0 +1,30 @@
import Combine
public extension Bus {
final class Receiver<T> {
var subscriptions = [AnyCancellable]()
public init(
_ keys: Set<String>,
_ handler: @escaping ((String, T) -> Void),
opt: [Option] = []
) {
Bus.receive(keys, handler, opt: opt, sub: &subscriptions)
}
}
}
import Combine
public extension Bus {
final class Sender<T> {
var subscriptions = [AnyCancellable]()
public init(
_ key: String,
_ node: AnyPublisher<T, Never>,
opt: [Option] = []
) {
Bus.send(key, node, opt: opt, sub: &subscriptions)
}
}
}