|
|
@@ -0,0 +1,15 @@ |
|
|
|
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) |
|
|
|
} |
|
|
|
} |
|
|
|
} |