Михаил Капелько 11 months ago
parent
commit
6886a049ae
3 changed files with 111 additions and 0 deletions
  1. +10
    -0
      Modules/MicX/Mic/Mic.yml
  2. +100
    -0
      Modules/MicX/Mic/src/Mic.Generated.swift
  3. +1
    -0
      src/App.swift

+ 10
- 0
Modules/MicX/Mic/Mic.yml View File

@@ -0,0 +1,10 @@
version: 2

model:
activityDates: [[String:Date], [:]]

service:
pipes:
activityDates: [recent, K.activityDates]

world:

+ 100
- 0
Modules/MicX/Mic/src/Mic.Generated.swift View 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 }
)




}

}
}

+ 1
- 0
src/App.swift View File

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


Loading…
Cancel
Save