Skip to content

Commit

Permalink
Simplify Stack Navigation Demo (#2758)
Browse files Browse the repository at this point in the history
It was pointed out in the Slack that the `Codable` conformance was
confusing and seems like a requirement, but neither `Codable` nor
`Hashable` is necessary, so I think these conformances are vestigial and
should be removed.
  • Loading branch information
stephencelis committed Feb 1, 2024
1 parent 7e3d0e2 commit 20c1438
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct NavigationDemo {
@Reducer
struct Path {
@ObservableState
enum State: Codable, Equatable, Hashable {
enum State: Equatable {
case screenA(ScreenA.State = .init())
case screenB(ScreenB.State = .init())
case screenC(ScreenC.State = .init())
Expand Down Expand Up @@ -208,7 +208,7 @@ struct FloatingMenuView: View {
@Reducer
struct ScreenA {
@ObservableState
struct State: Codable, Equatable, Hashable {
struct State: Equatable {
var count = 0
var fact: String?
var isLoading = false
Expand Down Expand Up @@ -339,7 +339,7 @@ struct ScreenAView: View {
@Reducer
struct ScreenB {
@ObservableState
struct State: Codable, Equatable, Hashable {}
struct State: Equatable {}

enum Action {
case screenAButtonTapped
Expand Down Expand Up @@ -394,7 +394,7 @@ struct ScreenBView: View {
@Reducer
struct ScreenC {
@ObservableState
struct State: Codable, Equatable, Hashable {
struct State: Equatable {
var count = 0
var isTimerRunning = false
}
Expand Down

0 comments on commit 20c1438

Please sign in to comment.