CombineX(中文)
CombineX is an open source implementation for Apple's Combine. It allows you to get rid of platform and version restrictions, and use Combine's API now.
This library is still in beta, so do not use it in production!
🐱
Compatible with Combine beta 6.
A new beta will be released every two weeks~
Combine is a responsive framework published 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 and behavior consistent with Combine, it has the following advantages:
Combine
has very high version restrictions: macOS 10.15+, iOS 13+. In other words, even if your app only needs to be compatible with two versions forward, it will take two to three years before you can use it. Combine
is exclusive to the Apple platform and does not support Linux.
CombineX
helps you get rid of these limitations, it supports macOS 10.12+, iOS 10+, and supports Linux. With CombineX
, you can use the same code on more platforms and versions.
'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
provides a number of related extensions, including but not limited to:
- CombineX.Foundation: provides all
Foundation
extension implementations, built on top ofCombineX
. For example,URLSession
,NotificationCenter
,Timer
,DispatchQueue+Scheduler
,RunLoop+Scheduler
, etc. - CombineX.Cocoa: provides
Cocoa
extension implementations, built on top ofCombineX
. For example,KVOPublisher
,MethodInterceptionPublisher
,UIKit+CX
, etc. - CombineX.Compatible: provides API Shims for
CombineX
to help you resolve migration concerns that may arise. With this library, you can easily switch the underlying library fromCombineX
toCombine
at any time.
dependencies.append(
.package(url: "https://github.com/luoxiu/CombineX", ._branchItem("master"))
)
pod 'CombineX.swift', :git => 'https://github.com/luoxiu/CombineX.git', :branch => 'master'
github "luoxiu/CombineX" "master"
Welcome! CombineX really need collaborators!!!
Now, what CombineX
need most are testing. You can:
- Add more functional tests.
- Make sure
Combine
can pass it. - If
CombineX
can not pass it, then you have found aCombineX
bug, you can open an issue, or fix it directly!
Since some people may not have macOS 10.15 beta installed, the recommended contributing way is:
- Fork the project.
- Open
Specs/Specs.xcworkspace
, make your changes underCombineX/CombineX
folder. - All tests go
CombineXTests/CombineXTests
folder. Make sure both schemeSpecs
and schemeCombineX
pass the tests you wrote.
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!