CombineX is an open source implementation for Apple's Combine. Its API is consistent with
Combine, which can be used as a
Combine polyfill on iOS 8, macOS 10.10 and Linux to help you get rid of system limitations and platform limitations.
This library is still in beta, so do not use it in production!
- iOS 8+ / macOS 10.10+ / tvOS 9+ / watchOS 2+
- Linux - Ubuntu 16.04
What is Combine
Combine is a reactive framework launched by Apple at WWDC 2019, which refers to the interface design of ReactiveX and provides Apple's preferred implementation for Swift asynchronous programming. It will definitely be the cornerstone of Swift programming in the foreseeable future.
What is CombineX
CombineX is an open source implementation of
Combine. In addition to having an API consistent with
Combine, it has the following advantages:
1. Systems and Platforms
Combinehas very high system version restrictions: macOS 10.15+, iOS 13+. This means, even if your app only needs to be compatible with three versions forward, it will take three or four years before you can use
Combineis exclusive to the Apple platform and does not support Linux, so you can't share codebases between apple and linux.
CombineX can help you get rid of these limitations, it supports macOS 10.10+, iOS 8+ and Linux.
2. Open source
Combine is closed source, it is like
MapKit, etc., updated with the update of Xcode. When you encounter a bug, "you should have encountered a system library bug", debugging is very annoying, but more annoying is the slow official response, usually, you can't do anything but wait for the next regular update of Xcode.
CombineX is completely open source, in addition to being able to debug line by line, you can also get faster community response!
CombineX provides a number of related extensions, including but not limited to:
- CXFoundation: provides
Foundationextension implementations, built on top of
CombineX. Such as
- CXCompatible: provides API Shims for
CombineXto help you resolve migration concerns that may arise. With this library, you can easily switch all code that depends on
Combineat any time.
CombineX, you are free to develop
Combine related frameworks without worrying about system version and platform limitations, such as:
- CXCocoa: provides
Cocoa, such as
Delegate Proxy, etc. Based on
CombineXby default, you are free to switch to
- CXExtensions: provides a collection of useful extensions for
Combine, such as
DelayedAutoCancellable, etc. Based on
CombineXby default, you are free to switch to
Want to get involved? Awesome!
CombineX really needs your help now! 🆘🆘🆘
📈 Project Management
We need help with project management!
CombineX is the first time I organize such a large open source project. It is based on a whim, driven by my enthusiasm for Swift and open source. I like writing code and implementing things, but now, I spend more time on organizing and deploying than writing code.
CombineX is not just a project anymore. It now has four associated repositories in addition to the main repository, amd I have a lot of new ideas waiting for verification. So we really need someone to help manage the entire project, including [cx-org] (https://github.com/cx-org) and [cx-community] (https://github.com/cx-community).
🔨 Looking for bugs
You can help
CombineX find bugs.
CombineX uses tests to ensure that it is consistent with the behavior of
Combine. But at the moment, the number of tests is far from enough, and there are still many edge cases that are not considered. You can add more tests to improve the quality of
CombineX. First, make sure the
Specs scheme passes your test. If the
CombineX scheme doesn't pass, you've found a
CombineX bug! You can give us feedback via issue, or - fix it directly!
💯 Improving implementation
CombineX was originally a side project of me. Due to time, there are a lot of things that can be done better. Currently, only the implementation of the functions is guaranteed. You can improve them, whether it is about performance, security, or readability. I will also focus on this part next.
💬 Participating in the discussion of issue and pr
You can also participate in the discussion of the issue and pr, answer other people's questions, and review the code.
Participation doesn't have to be related to the code, and it's even simpler, star! then tell your friends!
Because many people, like me, have not installed macOS 10.15 beta, so the recommended contribution flow is:
- Fork project
Specs/Specs.xcworkspaceand make your changes in the
- All tests are in the
CombineXTests/CombineXTestsfolder. Make sure your tests pass both the
⚠️⚠️⚠️ Do not open
CombineX.xcodeproj to edit, it only exists for Carthage.
Swift Package Manager
dependencies.append( .package(url: "https://github.com/cx-org/CombineX", .branch("master")) )
pod 'CombineX', :git => 'https://github.com/cx-org/CombineX.git', :branch => 'master'
github "cx-org/CombineX" "master"
Bugs in Combine
Combine is still in beta, it is inevitable that it has bugs. If you find something strange, open an issue and discuss it with us!