File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 22// MergedEffect<each Effect: AtomEffect>
33/// An atom effect that merges multiple atom effects into one.
44public struct MergedEffect : AtomEffect {
5+ private let initializing : @MainActor ( Context ) -> Void
56 private let initialized : @MainActor ( Context ) -> Void
67 private let updated : @MainActor ( Context ) -> Void
78 private let released : @MainActor ( Context ) -> Void
89
910 /// Creates an atom effect that merges multiple atom effects into one.
1011 public init < each Effect : AtomEffect > ( _ effect: repeat each Effect ) {
12+ initializing = { @Sendable context in
13+ repeat ( each effect) . initializing ( context: context)
14+ }
1115 initialized = { @Sendable context in
1216 repeat ( each effect) . initialized ( context: context)
1317 }
@@ -19,8 +23,14 @@ public struct MergedEffect: AtomEffect {
1923 }
2024 }
2125
22- /// A lifecycle event that is triggered when the atom is first used and initialized,
23- /// or once it is released and re-initialized again.
26+ /// A lifecycle event that is triggered before the atom is first used and initialized,
27+ /// or once it is released and re-initialized.
28+ public func initializing( context: Context ) {
29+ initializing ( context)
30+ }
31+
32+ /// A lifecycle event that is triggered after the atom is first used and initialized,
33+ /// or once it is released and re-initialized.
2434 public func initialized( context: Context ) {
2535 initialized ( context)
2636 }
You can’t perform that action at this time.
0 commit comments