d
This commit is contained in:
@@ -3,7 +3,7 @@ import Foundation
|
||||
public extension MeetupId {
|
||||
static func finishLoading(_ isLoading: Bool) -> Bool? {
|
||||
guard isLoading else { return nil }
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
static func formatId(_ s: String) -> String? {
|
||||
|
||||
@@ -12,6 +12,7 @@ import UIKit
|
||||
// MARK: - Context
|
||||
|
||||
public protocol MeetupIdContext {
|
||||
var finishLoading: Bool { get }
|
||||
var isLoading: MPAK.Recent<Bool> { get }
|
||||
var join: Bool { get }
|
||||
var textUI: MPAK.Recent<String> { get }
|
||||
@@ -35,6 +36,7 @@ extension MeetupId {
|
||||
// MARK: - Model
|
||||
|
||||
public struct Model: MeetupIdContext {
|
||||
public var finishLoading: Bool = false
|
||||
public var isLoading: MPAK.Recent<Bool> = .init(false)
|
||||
public var join: Bool = false
|
||||
public var textUI: MPAK.Recent<String> = .init("")
|
||||
@@ -93,6 +95,19 @@ extension MeetupId {
|
||||
|
||||
// MARK: - SectionGenerated Service Pipes
|
||||
|
||||
ctrl.pipe(
|
||||
dbg: "finishL",
|
||||
sub: nil,
|
||||
Bus.events.compactMap { Bus.convertKeyValue(K.finishLoading, $0) }.map { (k: String, v: Void) in v }.eraseToAnyPublisher(),
|
||||
{ $0.finishLoading = true },
|
||||
{ $0.finishLoading = false }
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ctrl.pipeValue(
|
||||
dbg: "isL",
|
||||
sub: nil,
|
||||
|
||||
@@ -11,7 +11,7 @@ extension MeetupId {
|
||||
let processors: [Any] = [
|
||||
Bus.Processor(shouldEnableJoin, K.M, K.isJoinAvailable),
|
||||
MeetupId.Debounce(0.2, formatId, K.textUI, K.textApp),
|
||||
MeetupId.Delay(5, finishLoading, K.isLoading, K.isLoading),
|
||||
MeetupId.Delay(5, finishLoading, K.isLoading, K.finishLoading),
|
||||
]
|
||||
|
||||
public init() { }
|
||||
|
||||
Reference in New Issue
Block a user