diff --git a/src/Bus.swift b/src/Bus.swift index b61cad6..19bc2da 100644 --- a/src/Bus.swift +++ b/src/Bus.swift @@ -90,16 +90,20 @@ public extension Bus { } public extension Bus { - static func registerProcessing( + static func processSync( _ subscriptions: inout Set, _ keyIn: String, _ keyOut: String, _ handler: @escaping ((Src) -> Dst?) ) { Service.singleton?.broadcaster - .filter { $0.key == keyIn } .compactMap { - guard let vIn = $0.value as? Src else { return nil } + guard + $0.key == keyIn, + let vIn = $0.value as? Src + else { + return nil + } return handler(vIn) } .sink { vOut in Service.singleton?.send(keyOut, vOut) } diff --git a/src/MeetupId.swift b/src/MeetupId.swift index 99df8ea..5435b8a 100644 --- a/src/MeetupId.swift +++ b/src/MeetupId.swift @@ -32,11 +32,11 @@ enum MeetupId { } init() { - Bus.registerProcessing( + Bus.processSync( &subscriptions, Keys.meetupIdTextUI.rawValue, Keys.meetupIdTextApp.rawValue, - MeetupId.shouldFormat + shouldFormat ) /**/print("ИГР MeetupIF.init") }