|
|
@@ -9,7 +9,9 @@ extension MicItem { |
|
|
|
public struct Model: MicItemContext { |
|
|
|
public var activityDate: MPAK.Recent<Date?> = .init(nil) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
extension MicItem { |
|
|
|
final class Controller: MPAK.Controller<MicItem.Model> { |
|
|
|
init() { |
|
|
|
/**/print("MicIC.init") |
|
|
@@ -24,6 +26,17 @@ extension MicItem { |
|
|
|
m |
|
|
|
.sink { v in Bus.send(K.MI, v) } |
|
|
|
.store(in: &subscriptions) |
|
|
|
|
|
|
|
pipeValue( |
|
|
|
dbg: "activityD", |
|
|
|
sub: nil, |
|
|
|
Bus.events.compactMap { Bus.convertKeyValue(K.activityDate, $0) }.map { (k: String, v: Date?) in v }.eraseToAnyPublisher(), |
|
|
|
{ |
|
|
|
$0.activityDate.value = $1 |
|
|
|
$0.activityDate.isRecent = true |
|
|
|
}, |
|
|
|
{ m, _ in m.activityDate.isRecent = false } |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |