|
|
@@ -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, |
|
|
|