File tree Expand file tree Collapse file tree 5 files changed +71
-0
lines changed Expand file tree Collapse file tree 5 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 33
44@available ( * , deprecated, renamed: " Dependencies " )
55public typealias ComposableDependencies = Dependencies
6+
7+ /// This namespace is used to provide non-clashing variants to the `DependencyKey` protocol and the
8+ /// `@Dependency` property wrapper.
9+ public enum Compatible { }
Original file line number Diff line number Diff line change @@ -175,3 +175,18 @@ extension Dependencies {
175175 ComposableEnvironment . aliases. clear ( )
176176 }
177177}
178+
179+ extension Compatible {
180+ /// You can use this typealias if `DependencyKey` is clashing with other modules offering
181+ /// a similarly named protocol.
182+ ///
183+ /// You should be able to replace:
184+ /// ```swift
185+ /// struct MainQueueKey: DependencyKey { … }
186+ /// ```
187+ /// by
188+ /// ```swift
189+ /// struct MainQueueKey: Compatible.DependencyKey { … }
190+ /// ```
191+ public typealias DependencyKey = _Dependencies . DependencyKey
192+ }
Original file line number Diff line number Diff line change @@ -70,3 +70,21 @@ public struct Dependency<Value> {
7070 set { fatalError ( ) }
7171 }
7272}
73+
74+ /// Convenience typealias in case of name clashes. See ``Compatible.Dependency``.
75+ public typealias ComposableEnvironmentDependency = Dependency
76+
77+ extension Compatible {
78+ /// You can use this typealias if `@Dependency` is clashing with other modules offering
79+ /// a similarly named property wrapper.
80+ ///
81+ /// You should be able to replace
82+ /// ```swift
83+ /// @Dependency(\.mainQueue) var mainQueue
84+ /// ```
85+ /// by
86+ /// ```swift
87+ /// @Compatible.Dependency(\.mainQueue) var mainQueue
88+ /// ```
89+ public typealias Dependency = ComposableEnvironmentDependency
90+ }
Original file line number Diff line number Diff line change @@ -35,3 +35,21 @@ public struct Dependency<Value> {
3535 Dependencies . global [ keyPath: Dependencies . aliases. standardAlias ( for: keyPath) ]
3636 }
3737}
38+
39+ /// Convenience typealias in case of name clashes. See ``Compatible.Dependency``.
40+ public typealias ComposableEnvironmentDependency = Dependency
41+
42+ extension Compatible {
43+ /// You can use this typealias if `@Dependency` is clashing with other modules offering
44+ /// a similarly named property wrapper.
45+ ///
46+ /// You should be able to replace
47+ /// ```swift
48+ /// @Dependency(\.mainQueue) var mainQueue
49+ /// ```
50+ /// by
51+ /// ```swift
52+ /// @Compatible.Dependency(\.mainQueue) var mainQueue
53+ /// ```
54+ public typealias Dependency = ComposableEnvironmentDependency
55+ }
Original file line number Diff line number Diff line change @@ -154,3 +154,19 @@ extension Dependencies {
154154 Dependencies . global = DependenciesUtilities . new ( )
155155 }
156156}
157+
158+ extension Compatible {
159+ /// You can use this typealias if `DependencyKey` is clashing with other modules offering
160+ /// a similarly named protocol.
161+ ///
162+ /// You should be able to replace:
163+ /// ```swift
164+ /// struct MainQueueKey: DependencyKey { … }
165+ /// ```
166+ /// by
167+ /// ```swift
168+ /// struct MainQueueKey: Compatible.DependencyKey { … }
169+ /// ```
170+ public typealias DependencyKey = _Dependencies . DependencyKey
171+ }
172+
You can’t perform that action at this time.
0 commit comments