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