|
|
@@ -96,7 +96,7 @@ public extension Bus { |
|
|
|
|
|
|
|
public extension Bus { |
|
|
|
static func process<Src, Dst>( |
|
|
|
_ keyIn: String, |
|
|
|
_ keysIn: Set<String>, |
|
|
|
_ keyOut: String, |
|
|
|
_ handler: @escaping ((Src) -> Dst?), |
|
|
|
opt: [Option] = [], |
|
|
@@ -108,7 +108,7 @@ public extension Bus { |
|
|
|
// Async. |
|
|
|
if isAsync { |
|
|
|
subscription = Service.singleton.events |
|
|
|
.compactMap { processKeyValue($0, keyIn, handler) } |
|
|
|
.compactMap { processKeysValue($0, keysIn, handler) } |
|
|
|
.receive(on: DispatchQueue.main) |
|
|
|
.sink { vOut in Service.singleton.send(keyOut, vOut) } |
|
|
|
} |
|
|
@@ -116,7 +116,7 @@ public extension Bus { |
|
|
|
// Sync. |
|
|
|
if !isAsync { |
|
|
|
subscription = Service.singleton.events |
|
|
|
.compactMap { processKeyValue($0, keyIn, handler) } |
|
|
|
.compactMap { processKeysValue($0, keysIn, handler) } |
|
|
|
.sink { vOut in Service.singleton.send(keyOut, vOut) } |
|
|
|
} |
|
|
|
|
|
|
|