Михаил Капелько 1年前
父节点
当前提交
5d5aa3d989
共有 3 个文件被更改,包括 27 次插入3 次删除
  1. +15
    -1
      Modules/BusX/src/Bus.Aux.swift
  2. +4
    -0
      Modules/BusX/src/Bus.swift
  3. +8
    -2
      Modules/MeetupIdX/src/MeetupId.Generated.swift

+ 15
- 1
Modules/BusX/src/Bus.Aux.swift 查看文件

@@ -1,4 +1,18 @@
extension Bus {
public extension Bus {
/// Пропускаем далее предоставленный ключ.
static func convertKeyValue<T>(
_ key: String,
_ v: (key: String, value: Any)
) -> (String, T)? {
guard
key == v.key,
let value = v.value as? T
else {
return nil
}
return (key, value)
}

/// Пропускаем далее предоставленные ключи.
static func convertKeyValue<T>(
_ keys: Set<String>,


+ 4
- 0
Modules/BusX/src/Bus.swift 查看文件

@@ -7,6 +7,10 @@ public extension Bus {
enum Option {
case async
}

static var events: AnyPublisher<(key: String, value: Any), Never> {
Service.singleton.events.eraseToAnyPublisher()
}
}

extension Bus {


+ 8
- 2
Modules/MeetupIdX/src/MeetupId.Generated.swift 查看文件

@@ -87,7 +87,10 @@ extension MeetupId {
ctrl.pipeValue(
dbg: "textA",
sub: nil,
K.meetupIdTextApp.eraseToAnyPublisher(),
Bus.events
.compactMap { Bus.convertKeyValue(K.meetupIdTextApp.rawValue, $0) }
.map { (k: String, v: String) -> String in v }
.eraseToAnyPublisher(),
{
$0.textApp.value = $1
$0.textApp.isRecent = true
@@ -100,7 +103,10 @@ extension MeetupId {
ctrl.pipeValue(
dbg: "textUI",
sub: nil,
K.meetupIdTextUI.eraseToAnyPublisher(),
Bus.events
.compactMap { Bus.convertKeyValue(K.meetupIdTextUI.rawValue, $0) }
.map { (k: String, v: String) -> String in v }
.eraseToAnyPublisher(),
{
$0.textUI.value = $1
$0.textUI.isRecent = true


正在加载...
取消
保存