From 6886a049ae72576e83b899d1bc05b4cb6ed45cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Thu, 25 Jan 2024 18:58:20 +0300 Subject: [PATCH] d --- Modules/MicX/Mic/Mic.yml | 10 +++ Modules/MicX/Mic/src/Mic.Generated.swift | 100 +++++++++++++++++++++++ src/App.swift | 1 + 3 files changed, 111 insertions(+) create mode 100644 Modules/MicX/Mic/Mic.yml create mode 100644 Modules/MicX/Mic/src/Mic.Generated.swift diff --git a/Modules/MicX/Mic/Mic.yml b/Modules/MicX/Mic/Mic.yml new file mode 100644 index 0000000..054adcc --- /dev/null +++ b/Modules/MicX/Mic/Mic.yml @@ -0,0 +1,10 @@ +version: 2 + +model: + activityDates: [[String:Date], [:]] + +service: + pipes: + activityDates: [recent, K.activityDates] + +world: diff --git a/Modules/MicX/Mic/src/Mic.Generated.swift b/Modules/MicX/Mic/src/Mic.Generated.swift new file mode 100644 index 0000000..cddc486 --- /dev/null +++ b/Modules/MicX/Mic/src/Mic.Generated.swift @@ -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 { + 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 } + ) + + + + + } + + } +} diff --git a/src/App.swift b/src/App.swift index ec542ad..e7dc8d4 100644 --- a/src/App.swift +++ b/src/App.swift @@ -38,6 +38,7 @@ struct Content: View { class AppDelegate: UIResponder, UIApplicationDelegate { let meetupIS = MeetupId.Service(.init()) + let micS = Mic.Service(.init()) var window: UIWindow? func application(