d
This commit is contained in:
10
Modules/MicX/Mic/Mic.yml
Normal file
10
Modules/MicX/Mic/Mic.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
version: 2
|
||||||
|
|
||||||
|
model:
|
||||||
|
activityDates: [[String:Date], [:]]
|
||||||
|
|
||||||
|
service:
|
||||||
|
pipes:
|
||||||
|
activityDates: [recent, K.activityDates]
|
||||||
|
|
||||||
|
world:
|
||||||
100
Modules/MicX/Mic/src/Mic.Generated.swift
Normal file
100
Modules/MicX/Mic/src/Mic.Generated.swift
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
// ВНИМАНИЕ Сгенерировано автоматом из файла Mic.yml
|
||||||
|
// ВНИМАНИЕ Не менять руками!
|
||||||
|
|
||||||
|
import AELog
|
||||||
|
import BusX
|
||||||
|
import Combine
|
||||||
|
import Foundation
|
||||||
|
import MPAKX
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
// MARK: - Context
|
||||||
|
|
||||||
|
public protocol MicContext {
|
||||||
|
var activityDates: MPAK.Recent<[String:Date]> { get }
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Controller
|
||||||
|
|
||||||
|
extension Mic {
|
||||||
|
final class Controller: MPAK.Controller<Mic.Model> {
|
||||||
|
init() {
|
||||||
|
super.init(
|
||||||
|
Mic.Model(),
|
||||||
|
debugClassName: "MicCtrl",
|
||||||
|
debugLog: { aelog($0) }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// MARK: - Model
|
||||||
|
|
||||||
|
public struct Model: MicContext {
|
||||||
|
public var activityDates: MPAK.Recent<[String:Date]> = .init([:])
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Service
|
||||||
|
|
||||||
|
public final class Service {
|
||||||
|
let ctrl = Controller()
|
||||||
|
let world: World
|
||||||
|
|
||||||
|
var subscriptions = [AnyCancellable]()
|
||||||
|
static private(set) weak var singleton: Service?
|
||||||
|
|
||||||
|
public init(_ world: World) {
|
||||||
|
self.world = world
|
||||||
|
Self.singleton = self
|
||||||
|
SectionGenerated.setupPlatform(ctrl, self, world)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - World
|
||||||
|
|
||||||
|
public struct World {
|
||||||
|
|
||||||
|
|
||||||
|
public init(
|
||||||
|
|
||||||
|
) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SectionGenerated {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// MARK: - SectionGenerated Service
|
||||||
|
|
||||||
|
static func setupPlatform(
|
||||||
|
_ ctrl: Controller,
|
||||||
|
_ service: Service,
|
||||||
|
_ world: World
|
||||||
|
) {
|
||||||
|
// MARK: - SectionGenerated Service Actions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// MARK: - SectionGenerated Service Pipes
|
||||||
|
|
||||||
|
ctrl.pipeValue(
|
||||||
|
dbg: "activityD",
|
||||||
|
sub: nil,
|
||||||
|
Bus.events.compactMap { Bus.convertKeyValue(K.activityDates, $0) }.map { (k: String, v: [String:Date]) in v }.eraseToAnyPublisher(),
|
||||||
|
{
|
||||||
|
$0.activityDates.value = $1
|
||||||
|
$0.activityDates.isRecent = true
|
||||||
|
},
|
||||||
|
{ m, _ in m.activityDates.isRecent = false }
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@ struct Content: View {
|
|||||||
class AppDelegate: UIResponder, UIApplicationDelegate
|
class AppDelegate: UIResponder, UIApplicationDelegate
|
||||||
{
|
{
|
||||||
let meetupIS = MeetupId.Service(.init())
|
let meetupIS = MeetupId.Service(.init())
|
||||||
|
let micS = Mic.Service(.init())
|
||||||
var window: UIWindow?
|
var window: UIWindow?
|
||||||
|
|
||||||
func application(
|
func application(
|
||||||
|
|||||||
Reference in New Issue
Block a user