This commit is contained in:
Михаил Капелько
2023-12-26 12:58:01 +03:00
parent f7127895e9
commit 34a63c92b3

16
src/Bus.Processor.swift Normal file
View File

@@ -0,0 +1,16 @@
import Combine
public extension Bus {
final class Processor<Src, Dst> {
var subscriptions = [AnyCancellable]()
public init(
_ keyIn: String,
_ keyOut: String,
_ handler: @escaping ((Src) -> Dst?),
opt: [Option] = []
) {
Bus.process(keyIn, keyOut, handler, opt: opt, sub: &subscriptions)
}
}
}