d
This commit is contained in:
@@ -5,18 +5,18 @@ public extension Bus {
|
||||
var subscriptions = [AnyCancellable]()
|
||||
|
||||
public init(
|
||||
_ handler: @escaping ((Src) -> Dst?),
|
||||
_ keyIn: String,
|
||||
_ keyOut: String,
|
||||
_ handler: @escaping ((Src) -> Dst?),
|
||||
opt: [Option] = []
|
||||
) {
|
||||
Bus.process([keyIn], keyOut, handler, opt: opt, sub: &subscriptions)
|
||||
}
|
||||
|
||||
public init(
|
||||
_ handler: @escaping ((Src) -> Dst?),
|
||||
_ keysIn: Set<String>,
|
||||
_ keyOut: String,
|
||||
_ handler: @escaping ((Src) -> Dst?),
|
||||
opt: [Option] = []
|
||||
) {
|
||||
Bus.process(keysIn, keyOut, handler, opt: opt, sub: &subscriptions)
|
||||
|
||||
@@ -90,7 +90,7 @@ extension MeetupId {
|
||||
ctrl.pipeValue(
|
||||
dbg: "textA",
|
||||
sub: nil,
|
||||
Bus.events.compactMap { Bus.convertKeyValue(K.meetupIdTextApp.rawValue, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher().eraseToAnyPublisher(),
|
||||
Bus.events.compactMap { Bus.convertKeyValue(K.meetupIdTextApp, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher().eraseToAnyPublisher(),
|
||||
{
|
||||
$0.textApp.value = $1
|
||||
$0.textApp.isRecent = true
|
||||
@@ -103,7 +103,7 @@ extension MeetupId {
|
||||
ctrl.pipeValue(
|
||||
dbg: "textUI",
|
||||
sub: nil,
|
||||
Bus.events.compactMap { Bus.convertKeyValue(K.meetupIdTextUI.rawValue, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher().eraseToAnyPublisher(),
|
||||
Bus.events.compactMap { Bus.convertKeyValue(K.meetupIdTextUI, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher().eraseToAnyPublisher(),
|
||||
{
|
||||
$0.textUI.value = $1
|
||||
$0.textUI.isRecent = true
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
public extension MeetupId {
|
||||
enum K: String {
|
||||
case meetupIdIsJoinAvailable
|
||||
case meetupIdJoin
|
||||
case meetupIdTextApp
|
||||
case meetupIdTextUI
|
||||
enum K {
|
||||
static let isJoinAvailable = "MeetupId.isJoinAvailable"
|
||||
static let join = "MeetupId.join"
|
||||
static let M = "MeetupId"
|
||||
static let textApp = "MeetupId.textApp"
|
||||
static let textUI = "MeetupId.textUI"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
7
Modules/MeetupIdX/src/MeetupId.Shoulds.swift
Normal file
7
Modules/MeetupIdX/src/MeetupId.Shoulds.swift
Normal file
@@ -0,0 +1,7 @@
|
||||
import Foundation
|
||||
|
||||
public extension MeetupId {
|
||||
static func shouldEnableJoin(_ c: MeetupIdContext) -> Bool? {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,10 @@ import SwiftUI
|
||||
|
||||
extension MeetupId {
|
||||
public struct V: View {
|
||||
@StateObject var isJA = Cord.Receive(K.meetupIdIsJoinAvailable.rawValue, false)
|
||||
@StateObject var join = Cord.Button(K.meetupIdJoin.rawValue)
|
||||
@StateObject var txtF = Cord.TextField(K.meetupIdTextApp.rawValue, K.meetupIdTextUI.rawValue)
|
||||
let test = Bus.Processor(K.meetupIdTextUI.rawValue, K.meetupIdIsJoinAvailable.rawValue, onlyAllowJoin)
|
||||
@StateObject var isJA = Cord.Receive(K.isJoinAvailable, false)
|
||||
@StateObject var join = Cord.Button(K.join)
|
||||
@StateObject var txtF = Cord.TextField(K.textApp, K.textUI)
|
||||
let joinA = Bus.Processor(shouldEnableJoin, K.M, K.isJoinAvailable)
|
||||
|
||||
public init() { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user