frzi / swiftui-router

Path-based routing in SwiftUI
MIT License
919 stars 44 forks source link

made Navigator Equatable #20

Closed 3a4oT closed 3 years ago

3a4oT commented 3 years ago

I use SwiftUIRouter with Composable architecture to make things easier I've added Equatable conformance to Navigator so it can be used inTCA action or state.

frzi commented 3 years ago

Interesting, I never considered making Navigator conform to Equatable.

I'm not well-versed with Composable architecture in SwiftUI. Is initializing a new Navigator something that occurs? I'm curious whether a simple instance comparison would suffice or not, instead of a deep comparison:

extension Navigator: Equatable {
    public func == (lhs: Navigator, rhs: Navigator) -> Bool {
        lhs === rhs
    }
}

Thanks!

3a4oT commented 3 years ago

Is initializing a new Navigator something that occurs

Not really I just pass a reference to action when I need to navigate somewhere so I'm fine to simplify things! Thanks!

3a4oT commented 3 years ago

Thanks! can I count on the new release any time soon?=)

3a4oT commented 3 years ago

BTW. for some reason, I don't see these changes on the main branch. Am I missing something? cc @frzi

frzi commented 3 years ago

I've reorganized pieces a bit as I was going through the documentation. Rest assured your changes are present in the main branch. 😉

Currently going through some things to prepare for 1.1.0, looking what to include and what not. If there's some urgency, you can tell Xcode to use the main branch instead of tagged releases in the meantime. 😉

3a4oT commented 3 years ago

Yeah, seems tit was a false-positive ping! Thanks