Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

Should support ViewStore too. #1

Open
mluisbrown opened this issue Jun 9, 2020 · 4 comments
Open

Should support ViewStore too. #1

mluisbrown opened this issue Jun 9, 2020 · 4 comments

Comments

@mluisbrown
Copy link

mluisbrown commented Jun 9, 2020

From the README:

Has no ViewStore. ViewStore was created for ergonomic reasons in SwiftUI and since SwiftUI is not supported, there's no reason for it to exist.

The ViewStore is not just for SwiftUI. It's a very useful concept to use in UIKit too.

One might assume that if the developer is targeting SwiftUI then Combine is obviously available, so there would be no need for this repo or the ReactiveSwift version. However, there are still good reasons to use ReactiveSwift or RxSwift even when Combine is available. Not least that both are OSS projects where bugs can be raised and fixed more quickly and transparently than in Combine.

The ReactiveSwift version of TCA does support ViewStore and SwiftUI btw.

@esam091
Copy link
Owner

esam091 commented Jun 10, 2020

The ViewStore is not just for SwiftUI. It's a very useful concept to use in UIKit too.
Can you give an example when this is useful compared to using the Store directly in UIKit?

I agree there may be some people who still prefer to use ReactiveSwift or RxSwift on SwiftUI, but that number would be so small compared to people who use Combine.

I'm still open to the possibility of supporting SwiftUI in the future, but considering the time and energy I have, supporting UIKit is going to be my main focus for now. I'm going to keep this issue open for a while though, to see whether people are interested in the SwiftUI version.

Good work on maintaining the ReactiveSwift version, I hope to be able to maintain this repo with the same quality 👍 .

@mluisbrown
Copy link
Author

Thanks for your comments 🙏

Even if you don't support SwiftUI, the ViewStore is still a useful concept even for UIKit as shown in the doc comments for ViewStore. You can implement it without the ObservableObject protocol and the @Published var state

@mluisbrown
Copy link
Author

FYI, there is another Rx port that you might be interested in, which does support ViewStore: https://github.com/dannyhertz/rx-swift-composable-architecture

@esam091
Copy link
Owner

esam091 commented Jun 12, 2020

Oh nice, I can see the appeal in having the API to be as similar as possible compared to the original, keeping up is easy. In the meanwhile, I need to do extra work to keep up 😅.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants