From 576f67e88216fee68a7e7055f5de4bf0868aad38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Sun, 31 Dec 2023 10:35:11 +0300 Subject: [PATCH] d --- Modules/BusX/Bus/src/Bus.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Modules/BusX/Bus/src/Bus.swift b/Modules/BusX/Bus/src/Bus.swift index 2aec9c0..3a9b236 100644 --- a/Modules/BusX/Bus/src/Bus.swift +++ b/Modules/BusX/Bus/src/Bus.swift @@ -16,7 +16,7 @@ public extension Bus { _ handler: @escaping ((String, T) -> Void), _ subscriptions: inout [AnyCancellable] ) { - Self.events + e .compactMap { convertKeyValue(keys, $0) } .receive(on: DispatchQueue.main) .sink { v in handler(v.0, v.1) } @@ -29,7 +29,7 @@ public extension Bus { _ handler: @escaping ((String, T) -> Void), _ subscriptions: inout [AnyCancellable] ) { - Self.events + e .compactMap { convertKeyValue(keys, $0) } .sink { v in handler(v.0, v.1) } .store(in: &subscriptions) @@ -43,7 +43,7 @@ public extension Bus { ) { node .receive(on: DispatchQueue.main) - .sink { v in Self.e.send((key, v)) } + .sink { v in e.send((key, v)) } .store(in: &subscriptions) } @@ -54,13 +54,13 @@ public extension Bus { _ subscriptions: inout [AnyCancellable] ) { node - .sink { v in Self.e.send((key, v)) } + .sink { v in e.send((key, v)) } .store(in: &subscriptions) } /// Синхронно отправить событие в шину один раз. static func send(_ key: String, _ value: Any) { - Self.e.send((key, value)) + e.send((key, value)) } } @@ -71,7 +71,7 @@ public extension Bus { _ handler: @escaping ((Src) -> Dst?), _ subscriptions: inout [AnyCancellable] ) { - Self.events + e .compactMap { processKeysValue($0, keysIn, handler) } .receive(on: DispatchQueue.main) .sink { vOut in Self.e.send((keyOut, vOut)) } @@ -84,7 +84,7 @@ public extension Bus { _ handler: @escaping ((Src) -> Dst?), _ subscriptions: inout [AnyCancellable] ) { - Self.events + e .compactMap { processKeysValue($0, keysIn, handler) } .sink { vOut in Self.e.send((keyOut, vOut)) } .store(in: &subscriptions)