Compare commits

10 Commits

Author SHA1 Message Date
Михаил Капелько
f4bb4e50e3 d 2024-01-06 18:43:44 +03:00
Михаил Капелько
a018cbee59 d 2024-01-06 18:41:12 +03:00
Михаил Капелько
676ec75bef d 2024-01-06 18:40:23 +03:00
Михаил Капелько
f11dde1c8e d 2024-01-06 18:38:19 +03:00
Михаил Капелько
676a1ada17 d 2024-01-06 18:35:45 +03:00
Михаил Капелько
f3807b76f6 d 2024-01-06 18:31:59 +03:00
Михаил Капелько
56512ca26a d 2024-01-06 18:22:22 +03:00
Михаил Капелько
a5de0484fd d 2024-01-06 17:59:47 +03:00
Михаил Капелько
f838021562 d 2024-01-06 17:59:15 +03:00
Михаил Капелько
752b34b95d d 2024-01-06 17:55:56 +03:00
8 changed files with 40 additions and 18 deletions

View File

@@ -0,0 +1,8 @@
extension MPAK {
public struct Many<T> {
public var keys = Set<String>()
public var dict = [String: T]()
public init() { }
}
}

View File

@@ -0,0 +1,10 @@
extension MPAK {
public struct Recent<T> {
public var isRecent = false
public var value: T
public init(_ value: T) {
self.value = value
}
}
}

View File

@@ -1,10 +1 @@
public enum MPAK { public enum MPAK { }
public struct Recent<T> {
public var isRecent = false
public var value: T
public init(_ value: T) {
self.value = value
}
}
}

View File

@@ -47,12 +47,14 @@ extension MeetupId {
let ctrl = Controller() let ctrl = Controller()
let world: World let world: World
var any = [Any]()
var subscriptions = [AnyCancellable]() var subscriptions = [AnyCancellable]()
static private(set) weak var singleton: Service? static private(set) weak var singleton: Service?
public init(_ world: World) { public init(_ world: World) {
self.world = world self.world = world
Self.singleton = self Self.singleton = self
SectionBus.setupService(ctrl, self, world)
SectionGenerated.setupPlatform(ctrl, self, world) SectionGenerated.setupPlatform(ctrl, self, world)
} }
} }

View File

@@ -0,0 +1,18 @@
import BusX
extension MeetupId {
enum SectionBus {
static func setupService(
_ ctrl: Controller,
_ service: Service,
_ world: World
) {
service.any.append(contentsOf: [
Bus.Debounce(shouldResetText, 0.2, K.M, K.textApp),
Bus.Delay(shouldFinishLoading, 5, K.M, K.finishLoading),
Bus.Sync(shouldEnableJoin, K.M, K.isJoinAvailable),
Bus.Sync(shouldResetLoading, K.M, K.isLoading)
])
}
}
}

View File

@@ -7,15 +7,8 @@ extension MeetupId {
@StateObject var isLoading = BusUI.Value(K.isLoading, false) @StateObject var isLoading = BusUI.Value(K.isLoading, false)
@StateObject var join = BusUI.Button(K.join) @StateObject var join = BusUI.Button(K.join)
@StateObject var textField = BusUI.TextField(K.textApp, K.textUI) @StateObject var textField = BusUI.TextField(K.textApp, K.textUI)
let processors: [Any]
public init() { public init() {
processors = [
Bus.Debounce(shouldResetText, 0.2, K.M, K.textApp),
Bus.Delay(shouldFinishLoading, 5, K.M, K.finishLoading),
Bus.Sync(shouldEnableJoin, K.M, K.isJoinAvailable),
Bus.Sync(shouldResetLoading, K.M, K.isLoading)
]
} }
public var body: some View { public var body: some View {

View File

@@ -36,6 +36,7 @@ extension %MODULE% {
let ctrl = Controller() let ctrl = Controller()
let world: World let world: World
%SERVICE_CORE% %SERVICE_CORE%
var any = [Any]()
var subscriptions = [AnyCancellable]() var subscriptions = [AnyCancellable]()
static private(set) weak var singleton: Service? static private(set) weak var singleton: Service?

View File

@@ -6,7 +6,6 @@ struct Content: View {
var body: some View { var body: some View {
MeetupId.V() MeetupId.V()
Divider() Divider()
MeetupId.V()
} }
} }