diff --git a/src/Bus.Processor.swift b/src/Bus.Processor.swift new file mode 100644 index 0000000..edf967e --- /dev/null +++ b/src/Bus.Processor.swift @@ -0,0 +1,16 @@ +import Combine + +public extension Bus { + final class Processor { + var subscriptions = [AnyCancellable]() + + public init( + _ keyIn: String, + _ keyOut: String, + _ handler: @escaping ((Src) -> Dst?), + opt: [Option] = [] + ) { + Bus.process(keyIn, keyOut, handler, opt: opt, sub: &subscriptions) + } + } +}