esam091 / RxComposableArchitecture

RxSwift implementation of ComposableArchitecture
MIT License
13 stars 0 forks source link

Should support ViewStore too. #1

Open mluisbrown opened 4 years ago

mluisbrown commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 😅.