@@ -13,29 +13,29 @@ import XCTestDynamicOverlay
13
13
// NB: Deprecated after 0.39.0:
14
14
15
15
#if canImport(SwiftUI)
16
- extension CaseLet {
17
- @available ( * , deprecated, renamed: " EnumState " )
18
- public typealias GlobalState = EnumState
16
+ extension CaseLet {
17
+ @available ( * , deprecated, renamed: " EnumState " )
18
+ public typealias GlobalState = EnumState
19
19
20
- @available ( * , deprecated, renamed: " EnumAction " )
21
- public typealias GlobalAction = EnumAction
20
+ @available ( * , deprecated, renamed: " EnumAction " )
21
+ public typealias GlobalAction = EnumAction
22
22
23
- @available ( * , deprecated, renamed: " CaseState " )
24
- public typealias LocalState = CaseState
23
+ @available ( * , deprecated, renamed: " CaseState " )
24
+ public typealias LocalState = CaseState
25
25
26
- @available ( * , deprecated, renamed: " CaseAction " )
27
- public typealias LocalAction = CaseAction
28
- }
26
+ @available ( * , deprecated, renamed: " CaseAction " )
27
+ public typealias LocalAction = CaseAction
28
+ }
29
29
#endif
30
30
31
31
#if DEBUG
32
- extension TestStore {
33
- @available ( * , deprecated, renamed: " ScopedState " )
34
- public typealias LocalState = ScopedState
32
+ extension TestStore {
33
+ @available ( * , deprecated, renamed: " ScopedState " )
34
+ public typealias LocalState = ScopedState
35
35
36
- @available ( * , deprecated, renamed: " ScopedAction " )
37
- public typealias LocalAction = ScopedAction
38
- }
36
+ @available ( * , deprecated, renamed: " ScopedAction " )
37
+ public typealias LocalAction = ScopedAction
38
+ }
39
39
#endif
40
40
41
41
// NB: Deprecated after 0.38.2:
@@ -44,8 +44,8 @@ extension Effect where Failure == Error {
44
44
@_disfavoredOverload
45
45
@available (
46
46
* ,
47
- deprecated,
48
- message: " Use the non-failing version of 'Effect.task' "
47
+ deprecated,
48
+ message: " Use the non-failing version of 'Effect.task' "
49
49
)
50
50
public static func task(
51
51
priority: TaskPriority ? = nil ,
@@ -84,8 +84,8 @@ extension Effect where Failure == Error {
84
84
/// - environment: The environment of dependencies for the application.
85
85
@available (
86
86
* ,
87
- deprecated,
88
- message:
87
+ deprecated,
88
+ message:
89
89
"""
90
90
If you use this initializer, please open a discussion on GitHub and let us know how: \
91
91
https://github.com/pointfreeco/swift-composable-architecture/discussions/new
@@ -133,8 +133,8 @@ extension ViewStore {
133
133
extension Effect {
134
134
@available (
135
135
* ,
136
- deprecated,
137
- message:
136
+ deprecated,
137
+ message:
138
138
"""
139
139
Using a variadic list is no longer supported. Use an array of identifiers instead. For more \
140
140
on this change, see: https://github.com/pointfreeco/swift-composable-architecture/pull/1041
@@ -151,8 +151,8 @@ extension Effect {
151
151
extension Reducer {
152
152
@available (
153
153
* ,
154
- deprecated,
155
- message: " 'pullback' no longer takes a 'breakpointOnNil' argument "
154
+ deprecated,
155
+ message: " 'pullback' no longer takes a 'breakpointOnNil' argument "
156
156
)
157
157
public func pullback< ParentState, ParentAction, ParentEnvironment> (
158
158
state toChildState: CasePath < ParentState , State > ,
@@ -173,8 +173,8 @@ extension Reducer {
173
173
174
174
@available (
175
175
* ,
176
- deprecated,
177
- message: " 'optional' no longer takes a 'breakpointOnNil' argument "
176
+ deprecated,
177
+ message: " 'optional' no longer takes a 'breakpointOnNil' argument "
178
178
)
179
179
public func optional(
180
180
breakpointOnNil: Bool ,
@@ -188,8 +188,8 @@ extension Reducer {
188
188
189
189
@available (
190
190
* ,
191
- deprecated,
192
- message: " 'forEach' no longer takes a 'breakpointOnNil' argument "
191
+ deprecated,
192
+ message: " 'forEach' no longer takes a 'breakpointOnNil' argument "
193
193
)
194
194
public func forEach< ParentState, ParentAction, ParentEnvironment, ID> (
195
195
state toElementsState: WritableKeyPath < ParentState , IdentifiedArray < ID , State > > ,
@@ -210,8 +210,8 @@ extension Reducer {
210
210
211
211
@available (
212
212
* ,
213
- deprecated,
214
- message: " 'forEach' no longer takes a 'breakpointOnNil' argument "
213
+ deprecated,
214
+ message: " 'forEach' no longer takes a 'breakpointOnNil' argument "
215
215
)
216
216
public func forEach< ParentState, ParentAction, ParentEnvironment, Key> (
217
217
state toElementsState: WritableKeyPath < ParentState , [ Key : State ] > ,
@@ -267,13 +267,13 @@ extension Reducer {
267
267
var actions = " "
268
268
customDump ( self . receivedActions. map ( \. action) , to: & actions)
269
269
XCTFail (
270
- """
271
- Must handle \( self . receivedActions. count) received \
272
- action \( self . receivedActions. count == 1 ? " " : " s " ) before performing this work: …
270
+ """
271
+ Must handle \( self . receivedActions. count) received \
272
+ action \( self . receivedActions. count == 1 ? " " : " s " ) before performing this work: …
273
273
274
- Unhandled actions: \( actions)
275
- """ ,
276
- file: step. file, line: step. line
274
+ Unhandled actions: \( actions)
275
+ """ ,
276
+ file: step. file, line: step. line
277
277
)
278
278
}
279
279
do {
@@ -287,13 +287,13 @@ extension Reducer {
287
287
var actions = " "
288
288
customDump ( self . receivedActions. map ( \. action) , to: & actions)
289
289
XCTFail (
290
- """
291
- Must handle \( self . receivedActions. count) received \
292
- action \( self . receivedActions. count == 1 ? " " : " s " ) before performing this work: …
290
+ """
291
+ Must handle \( self . receivedActions. count) received \
292
+ action \( self . receivedActions. count == 1 ? " " : " s " ) before performing this work: …
293
293
294
- Unhandled actions: \( actions)
295
- """ ,
296
- file: step. file, line: step. line
294
+ Unhandled actions: \( actions)
295
+ """ ,
296
+ file: step. file, line: step. line
297
297
)
298
298
}
299
299
do {
@@ -392,14 +392,14 @@ extension Reducer {
392
392
}
393
393
}
394
394
}
395
- #endif
395
+ #endif
396
396
397
- // NB: Deprecated after 0.27.1:
398
- #if canImport(SwiftUI)
397
+ // NB: Deprecated after 0.27.1:
398
+ #if canImport(SwiftUI)
399
399
extension AlertState . Button {
400
400
@available (
401
401
* , deprecated,
402
- message: " Cancel buttons must be given an explicit label as their first argument "
402
+ message: " Cancel buttons must be given an explicit label as their first argument "
403
403
)
404
404
public static func cancel( action: AlertState . ButtonAction ? = nil ) -> Self {
405
405
. init( action: action, label: TextState ( " Cancel " ) , role: . cancel)
@@ -430,7 +430,7 @@ extension Reducer {
430
430
extension Store {
431
431
@available (
432
432
* , deprecated,
433
- message:
433
+ message:
434
434
"""
435
435
If you use this method, please open a discussion on GitHub and let us know how: \
436
436
https://github.com/pointfreeco/swift-composable-architecture/discussions/new
@@ -476,7 +476,7 @@ extension Reducer {
476
476
477
477
@available (
478
478
* , deprecated,
479
- message:
479
+ message:
480
480
"""
481
481
If you use this method, please open a discussion on GitHub and let us know how: \
482
482
https://github.com/pointfreeco/swift-composable-architecture/discussions/new
@@ -494,7 +494,7 @@ extension Reducer {
494
494
extension ViewStore where Action: BindableAction , Action. State == State {
495
495
@available (
496
496
* , deprecated,
497
- message:
497
+ message:
498
498
"""
499
499
Dynamic member lookup is no longer supported for bindable state. Instead of dot-chaining on \
500
500
the view store, e.g. 'viewStore.$value', invoke the 'binding' method on view store with a \
@@ -517,7 +517,7 @@ extension Reducer {
517
517
extension BindingAction {
518
518
@available (
519
519
* , deprecated,
520
- message:
520
+ message:
521
521
"""
522
522
For improved safety, bindable properties must now be wrapped explicitly in 'BindableState', \
523
523
and accessed via key paths to that 'BindableState', like ' \\ .$value'
@@ -537,7 +537,7 @@ extension Reducer {
537
537
538
538
@available (
539
539
* , deprecated,
540
- message:
540
+ message:
541
541
"""
542
542
For improved safety, bindable properties must now be wrapped explicitly in 'BindableState', \
543
543
and accessed via key paths to that 'BindableState', like ' \\ .$value'
@@ -554,14 +554,14 @@ extension Reducer {
554
554
extension Reducer {
555
555
@available (
556
556
* , deprecated,
557
- message:
557
+ message:
558
558
"""
559
559
'Reducer.binding()' no longer takes an explicit extract function and instead the reducer's \
560
560
'Action' type must conform to 'BindableAction'
561
561
"""
562
562
)
563
563
public func binding( action toBindingAction: @escaping ( Action ) -> BindingAction < State > ? )
564
- -> Self
564
+ -> Self
565
565
{
566
566
Self { state, action, environment in
567
567
toBindingAction ( action) ? . set ( & state)
@@ -571,27 +571,27 @@ extension Reducer {
571
571
}
572
572
573
573
#if canImport(SwiftUI)
574
- extension ViewStore {
575
- @available (
576
- * , deprecated,
577
- message:
578
- """
574
+ extension ViewStore {
575
+ @available (
576
+ * , deprecated,
577
+ message:
578
+ """
579
579
For improved safety, bindable properties must now be wrapped explicitly in 'BindableState'. \
580
580
Bindings are now derived via 'ViewStore.binding' with a key path to that 'BindableState' \
581
581
(for example, 'viewStore.binding( \\ .$value)'). For dynamic member lookup to be available, \
582
582
the view store's 'Action' type must also conform to 'BindableAction'.
583
583
"""
584
+ )
585
+ public func binding< Value: Equatable > (
586
+ keyPath: WritableKeyPath < State , Value > ,
587
+ send action: @escaping ( BindingAction < State > ) -> Action
588
+ ) -> Binding < Value > {
589
+ self . binding (
590
+ get: { $0 [ keyPath: keyPath] } ,
591
+ send: { action ( . set( keyPath, $0) ) }
584
592
)
585
- public func binding< Value: Equatable > (
586
- keyPath: WritableKeyPath < State , Value > ,
587
- send action: @escaping ( BindingAction < State > ) -> Action
588
- ) -> Binding < Value > {
589
- self . binding (
590
- get: { $0 [ keyPath: keyPath] } ,
591
- send: { action ( . set( keyPath, $0) ) }
592
- )
593
- }
594
593
}
594
+ }
595
595
#endif
596
596
597
597
// NB: Deprecated after 0.23.0:
@@ -706,16 +706,10 @@ extension Reducer {
706
706
@ViewBuilder content: @escaping ( Store < EachState , EachAction > ) -> EachContent
707
707
)
708
708
where
709
- Data == [ EachState ] ,
710
- Content == WithViewStore <
711
- [ ID ] , ( Data . Index , EachAction ) ,
712
- _ConditionalContent <
713
- AnyView ,
714
- _ObservedObjectViewStore <
715
- [ ID ] , ( Int , EachAction ) , ForEach < [ ( offset: Int , element: ID ) ] , ID , EachContent >
716
- >
717
- >
718
- >
709
+ Data == [ EachState ] ,
710
+ Content == WithViewStore <
711
+ [ ID ] , ( Data . Index , EachAction ) , ForEach < [ ( offset: Int , element: ID ) ] , ID , EachContent >
712
+ >
719
713
{
720
714
let data = store. state
721
715
self . data = data
@@ -739,18 +733,12 @@ extension Reducer {
739
733
@ViewBuilder content: @escaping ( Store < EachState , EachAction > ) -> EachContent
740
734
)
741
735
where
742
- Data == [ EachState ] ,
743
- Content == WithViewStore <
744
- [ ID ] , ( Data . Index , EachAction ) ,
745
- _ConditionalContent <
746
- AnyView ,
747
- _ObservedObjectViewStore <
748
- [ ID ] , ( Int , EachAction ) , ForEach < [ ( offset: Int , element: ID ) ] , ID , EachContent >
749
- >
750
- >
751
- > ,
752
- EachState: Identifiable ,
753
- EachState. ID == ID
736
+ Data == [ EachState ] ,
737
+ Content == WithViewStore <
738
+ [ ID ] , ( Data . Index , EachAction ) , ForEach < [ ( offset: Int , element: ID ) ] , ID , EachContent >
739
+ > ,
740
+ EachState: Identifiable ,
741
+ EachState. ID == ID
754
742
{
755
743
self . init ( store, id: \. id, content: content)
756
744
}
0 commit comments