CombineX(中文)
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
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.
CombineX
is an open source implementation of Combine
. In addition to having an API consistent with Combine
, it has the following advantages:
Combine
has 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 useCombine
.Combine
is 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.
Combine
is closed source, it is like UIKit
, 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
Foundation
extension implementations, built on top ofCombineX
. Such asURLSession
,NotificationCenter
,Timer
,DispatchQueue/RunLoop/OperationQueue+Scheduler
,JSON/Plist+Coder
, etc. - CXCompatible: provides API Shims for
CombineX
to help you resolve migration concerns that may arise. With this library, you can easily switch all code that depends onCombineX
toCombine
at any time.
With CombineX
, you are free to develop Combine
related frameworks without worrying about system version and platform limitations, such as:
- CXCocoa: provides
Combine
extensions toCocoa
, such asKVO+Publisher
,Method Interception
,UIBinding
,Delegate Proxy
, etc. Based onCombineX
by default, you are free to switch toCombine
. - CXExtensions: provides a collection of useful extensions for
Combine
, such asIgnoreError
,DelayedAutoCancellable
, etc. Based onCombineX
by default, you are free to switch toCombine
.
Want to get involved? Awesome! CombineX
really needs your help now! 🆘🆘🆘
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).
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!
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.
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!
Open Package.swift
directly with xcode 11, don't use CombineX.xcodeproj
, it only exists for carthage.
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"
Since 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!