From a27fd7adc45fc473a5e55ae511163c703e14bcb2 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, 28 Dec 2023 15:31:53 +0300 Subject: [PATCH] d --- Modules/MeetupIdX/MeetupId.yml | 2 +- Modules/MeetupIdX/src/MeetupId.Generated.swift | 3 +++ .../generation/generateServiceSectionGeneratedActions.py | 9 ++++++++- .../templates/service-section-generated-action-bus-model | 3 +++ src/App.swift | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 Utilities/platform/2/templates/service-section-generated-action-bus-model diff --git a/Modules/MeetupIdX/MeetupId.yml b/Modules/MeetupIdX/MeetupId.yml index 865cc80..9948cac 100644 --- a/Modules/MeetupIdX/MeetupId.yml +++ b/Modules/MeetupIdX/MeetupId.yml @@ -6,7 +6,7 @@ model: service: actions: - modelBus + busModel pipes: textApp: [recent, K.meetupIdTextApp] textUI: [recent, K.meetupIdTextUI] diff --git a/Modules/MeetupIdX/src/MeetupId.Generated.swift b/Modules/MeetupIdX/src/MeetupId.Generated.swift index 67d017e..729b3df 100644 --- a/Modules/MeetupIdX/src/MeetupId.Generated.swift +++ b/Modules/MeetupIdX/src/MeetupId.Generated.swift @@ -80,6 +80,9 @@ extension MeetupId { ) { // MARK: - SectionGenerated Service Actions + ctrl.m + .sink { v in Bus.send("MeetupId", v) } + .store(in: &service.subscriptions) // MARK: - SectionGenerated Service Pipes diff --git a/Utilities/platform/2/generation/generateServiceSectionGeneratedActions.py b/Utilities/platform/2/generation/generateServiceSectionGeneratedActions.py index 59522d9..9f3dfb9 100644 --- a/Utilities/platform/2/generation/generateServiceSectionGeneratedActions.py +++ b/Utilities/platform/2/generation/generateServiceSectionGeneratedActions.py @@ -2,6 +2,7 @@ from generation.sectionGeneratedActionShouldLoad import * def generateServiceSectionGeneratedActions(c): base = f"{c.dir}/templates/service-section-generated-action" + fmtBusModel = c.readFile(f"{base}-bus-model") fmtCommon = c.readFile(base) fmtInstant = c.readFile(f"{base}-instant") fmtRelay = c.readFile(f"{base}-relay") @@ -21,6 +22,11 @@ def generateServiceSectionGeneratedActions(c): # Шаблонные действия. if value == "": + # busModel. + if key == "busModel": + c.serviceSectionGeneratedActions += "\n".join(fmtBusModel) + "\n" + continue + # instant model. if key == "🚀model": c.serviceSectionGeneratedActions += "\n".join(fmtInstantModel) + "\n" @@ -66,7 +72,8 @@ def generateServiceSectionGeneratedActions(c): for fmt in template: ln = fmt \ .replace("%SHOULD%", action) \ - .replace("%SINK%", value) + .replace("%SINK%", value) \ + .replace("%MODULE%", c.module) output += ln + "\n" c.serviceSectionGeneratedActions += output diff --git a/Utilities/platform/2/templates/service-section-generated-action-bus-model b/Utilities/platform/2/templates/service-section-generated-action-bus-model new file mode 100644 index 0000000..3c07717 --- /dev/null +++ b/Utilities/platform/2/templates/service-section-generated-action-bus-model @@ -0,0 +1,3 @@ + ctrl.m + .sink { v in Bus.send("%MODULE%", v) } + .store(in: &service.subscriptions) diff --git a/src/App.swift b/src/App.swift index 9e61c88..61d4d05 100644 --- a/src/App.swift +++ b/src/App.swift @@ -4,6 +4,7 @@ import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { + let meetupIS = MeetupId.Service(.init()) var window: UIWindow? func application(