|
@@ -11,7 +11,7 @@ import UIKit |
|
|
// MARK: - Context |
|
|
// MARK: - Context |
|
|
|
|
|
|
|
|
public protocol MicItemContext { |
|
|
public protocol MicItemContext { |
|
|
var activityDates: MPAK.Recent<Date?> { get } |
|
|
|
|
|
|
|
|
var activityDate: MPAK.Recent<Date?> { get } |
|
|
var timeout: Bool { get } |
|
|
var timeout: Bool { get } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -20,7 +20,7 @@ extension MicItem { |
|
|
// MARK: - Model |
|
|
// MARK: - Model |
|
|
|
|
|
|
|
|
public struct Model: MicItemContext { |
|
|
public struct Model: MicItemContext { |
|
|
public var activityDates: MPAK.Recent<Date?> = .init(nil) |
|
|
|
|
|
|
|
|
public var activityDate: MPAK.Recent<Date?> = .init(nil) |
|
|
public var timeout: Bool = false |
|
|
public var timeout: Bool = false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -45,12 +45,12 @@ extension MicItem { |
|
|
|
|
|
|
|
|
pipeValue( |
|
|
pipeValue( |
|
|
dbg: "activityD", |
|
|
dbg: "activityD", |
|
|
Bus.events.compactMap { Bus.convertKeyValue(Bus.keyId(K.activityDates, id), $0) }.map { (k: String, v: Date?) in v }.eraseToAnyPublisher(), |
|
|
|
|
|
|
|
|
Bus.events.compactMap { Bus.convertKeyValue(Bus.keyId(K.activityDate, id), $0) }.map { (k: String, v: Date?) in v }.eraseToAnyPublisher(), |
|
|
{ |
|
|
{ |
|
|
$0.activityDates.value = $1 |
|
|
|
|
|
$0.activityDates.isRecent = true |
|
|
|
|
|
|
|
|
$0.activityDate.value = $1 |
|
|
|
|
|
$0.activityDate.isRecent = true |
|
|
}, |
|
|
}, |
|
|
{ m, _ in m.activityDates.isRecent = false } |
|
|
|
|
|
|
|
|
{ m, _ in m.activityDate.isRecent = false } |
|
|
) |
|
|
) |
|
|
pipe( |
|
|
pipe( |
|
|
dbg: "timeout", |
|
|
dbg: "timeout", |
|
|