|
@@ -8,13 +8,8 @@ extension BusUI { |
|
|
let textUI: String |
|
|
let textUI: String |
|
|
@Published public var id: String? |
|
|
@Published public var id: String? |
|
|
@Published public var v = "a:" |
|
|
@Published public var v = "a:" |
|
|
{ |
|
|
|
|
|
didSet { |
|
|
|
|
|
/**/print("ИГР BusUMTF.v didSet: '\(v)'") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
var subscriptions = [AnyCancellable]() |
|
|
|
|
|
var sub = [AnyCancellable]() |
|
|
var sub = [AnyCancellable]() |
|
|
|
|
|
var subscriptions = [AnyCancellable]() |
|
|
|
|
|
|
|
|
public init( |
|
|
public init( |
|
|
_ textApp: String, |
|
|
_ textApp: String, |
|
@@ -22,17 +17,13 @@ extension BusUI { |
|
|
) { |
|
|
) { |
|
|
self.textApp = textApp |
|
|
self.textApp = textApp |
|
|
self.textUI = textUI |
|
|
self.textUI = textUI |
|
|
|
|
|
|
|
|
/**///print("ИГР BusUTF(\(Unmanaged.passUnretained(self).toOpaque())).init textA/textU: '\(textApp)'/'\(textUI)'") |
|
|
|
|
|
|
|
|
|
|
|
$id |
|
|
$id |
|
|
.sink { [weak self] v in self?.setup(v) } |
|
|
|
|
|
|
|
|
.sink { [weak self] id in self?.setup(id) } |
|
|
.store(in: &sub) |
|
|
.store(in: &sub) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private func setup(_ id: String?) { |
|
|
private func setup(_ id: String?) { |
|
|
/**/print("ИГР BusUTF(\(Unmanaged.passUnretained(self).toOpaque())).setup id: '\(id)'") |
|
|
|
|
|
|
|
|
|
|
|
subscriptions = [] |
|
|
subscriptions = [] |
|
|
|
|
|
|
|
|
Bus.sendSync( |
|
|
Bus.sendSync( |
|
@@ -57,7 +48,6 @@ extension BusUI { |
|
|
Bus.receiveSync( |
|
|
Bus.receiveSync( |
|
|
[textApp], |
|
|
[textApp], |
|
|
{ [weak self] (_, m: MPAK.Many<String>) in |
|
|
{ [weak self] (_, m: MPAK.Many<String>) in |
|
|
/**/print("ИГР BusUMTF.receiveS-1 id: '\(id)'") |
|
|
|
|
|
guard |
|
|
guard |
|
|
let id, |
|
|
let id, |
|
|
m.keys.contains(id), |
|
|
m.keys.contains(id), |
|
@@ -65,8 +55,6 @@ extension BusUI { |
|
|
else { |
|
|
else { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
/**/print("ИГР BusUMTF.receiveS-2 id: '\(id)'") |
|
|
|
|
|
|
|
|
|
|
|
self?.v = "a:\(text)" |
|
|
self?.v = "a:\(text)" |
|
|
}, |
|
|
}, |
|
|
&subscriptions |
|
|
&subscriptions |
|
|