New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Consideration] Bridge from OpenCombine to Combine publishers #217
Comments
I implemented a prototype this evening, maybe I'll make a draft PR tomorrow after cleaning up the codebase (or maybe @broadwaylamb may create a separate repo for the bridge if needed)
|
Thanks @maximkrouk for your support, I tried to achieve my goal creating a draft custom
Of course, this is only linked to publisher. Thanks again 🤙🏻 |
My implementation is more low-level and relies on Combine private API, so you can't be sure that it won't break, so depending on what does @broadwaylamb thinks about it it might be rewritten to something higher-level, like your suggestion, so thank u for sharing 🙂 |
My implementation is more low-level and relies on Combine private API, so you can't be sure that it won't break, so depending on what does @broadwaylamb think about it, it might be rewritten to something higher-level, like your suggestion, so thank u for sharing 🙂 |
same idea here, so +1. |
uuh sometime one more cofé helps.. import Combine
class SomeCombineUsingClass : ObservableObject {
//...
}
//to
import OpenCombine
class SomeCombineUsingClass : OpenCombine.ObservableObject {
//...
} now taking on the missing |
Yep, the issue is not in the bridge, but in Combine&OpenCombine, you have to use Module prefix if both modules are imported, but afaik you won't have to use it if you import OpenCombineBridge and one of the Combine frameworks 🤔 OpenCombine is more like a replacement for the Combine, so in general it's not meant to be used with the Combine and names are kept the same 🙂 Sadly some features are still not available 😔 |
that leaves me with a simple question.. how to take on code parts that make use of Maybe a blunt thought into the dust .. when |
I think you can just do this: typealias Published = OpenOmbine.Published This way you don't have to rewrite all your properties. |
nice one! thank you. but i can not admit done yet. Now thinking.. same has to be done for Scheduler and who knows what will come up after.. but step by step. someObserveable.$highlighted
.receive(on: DispatchQueue.main) //<---- Argument type 'DispatchQueue' does not conform to expected type 'Scheduler'
.sink { [weak self] newValue in
self?.overlayView.needsDisplay = true
}
.store(in: &cancellables) So i tried additionally |
Instead of |
compile success. Resume..
made it work. Thank you very much |
Hi guys,
I know there was already somebody talking about a "interoperability" between OpenCombine and Combine (here the issue) and possibly would be out of scope but here there is my situation and I would understand if the solution I'm thinking can be implementable:
I currently have an SDK written using OpenCombine, the project, which is including the SDK, will support iOS 13+, so I would use Apple Combine on that side.
The main and only nice to have would be a sort of
OpenCombine.Publisher
extension useful to convert thePublisher
toCombine .Publisher
. In this scenario, it would be pretty easy to quickly integrate the SDK inside the App and work with Combine.Publisher
andSubscriber
to correctly convert fromOpenCombine.Publisher
? (Any suggestion is welcome)I know something was done for
RxSwift
with RxCombine.Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: