@@ -22,7 +22,7 @@ public struct PageNavigationFeature: Reducer, Sendable {
2222
2323 public init ( ) { }
2424
25- //MARK: - State
25+ // MARK: - State
2626
2727 @ObservableState
2828 public struct State : Equatable {
@@ -31,9 +31,9 @@ public struct PageNavigationFeature: Reducer, Sendable {
3131 @Shared ( . appSettings) var appSettings : AppSettings
3232
3333 let type : PageNavigationType
34- public var page : String = " 1 "
35- public var count : Int = 0
36- public var offset : Int = 0
34+ public var page = " 1 "
35+ public var count = 0
36+ public var offset = 0
3737 var perPage : Int
3838 public var focus : Field ?
3939 public var shouldShow : Bool {
@@ -65,7 +65,7 @@ public struct PageNavigationFeature: Reducer, Sendable {
6565 }
6666 }
6767
68- //MARK: - Action
68+ // MARK: - Action
6969
7070 public enum Action : BindableAction {
7171 case binding( BindingAction < State > )
@@ -81,7 +81,7 @@ public struct PageNavigationFeature: Reducer, Sendable {
8181 case offsetChanged( to: Int )
8282 }
8383
84- //MARK: - Body
84+ // MARK: - Body
8585
8686 public var body : some Reducer < State , Action > {
8787 BindingReducer ( )
@@ -115,15 +115,15 @@ public struct PageNavigationFeature: Reducer, Sendable {
115115
116116 case . firstPageTapped:
117117 state. offset = 0
118- state. page = " 1 "
118+ state. page = String ( state . currentPage )
119119
120120 case . previousPageTapped:
121121 state. offset -= state. perPage
122- state. page = " \ ( state. currentPage) "
122+ state. page = String ( state. currentPage)
123123
124124 case . nextPageTapped:
125125 state. offset += state. perPage
126- state. page = " \ ( state. currentPage) "
126+ state. page = String ( state. currentPage)
127127
128128 case . lastPageTapped:
129129 let targetOffset = state. count - ( state. count % state. perPage)
@@ -132,7 +132,7 @@ public struct PageNavigationFeature: Reducer, Sendable {
132132 } else {
133133 state. offset = targetOffset
134134 }
135- state. page = " \ ( state. currentPage) "
135+ state. page = String ( state. currentPage)
136136
137137 case let . update( count: count, offset: offset) :
138138 state. count = count
@@ -147,6 +147,5 @@ public struct PageNavigationFeature: Reducer, Sendable {
147147 await send ( . offsetChanged( to: offset) )
148148 }
149149 }
150- // ._printChanges()
151150 }
152151}
0 commit comments