# OpenCombine **Repository Path**: mirrors/OpenCombine ## Basic Information - **Project Name**: OpenCombine - **Description**: OpenCombine 是苹果公司的 Combine 框架的开源实现,用于处理随时间变化的值 - **Primary Language**: Swift - **License**: MIT - **Default Branch**: master - **Homepage**: https://www.oschina.net/p/opencombine - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2019-06-20 - **Last Updated**: 2025-09-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OpenCombine [](https://codecov.io/gh/OpenCombine/OpenCombine)  [](https://cocoapods.org/pods/OpenCombine) Open-source implementation of Apple's [Combine](https://developer.apple.com/documentation/combine) framework for processing values over time. The main goal of this project is to provide a compatible, reliable and efficient implementation which can be used on Apple's operating systems before macOS 10.15 and iOS 13, as well as Linux, Windows and WebAssembly. | **CI Status** | |---| |[](https://github.com/OpenCombine/OpenCombine/actions/workflows/compatibility_tests.yml)| |[](https://github.com/OpenCombine/OpenCombine/actions/workflows/macos.yml)| |[](https://github.com/OpenCombine/OpenCombine/actions/workflows/ubuntu.yml)| |[](https://github.com/OpenCombine/OpenCombine/actions/workflows/windows.yml)| |[](https://github.com/OpenCombine/OpenCombine/actions/workflows/wasm.yml)| ### Installation `OpenCombine` contains three public targets: `OpenCombine`, `OpenCombineFoundation` and `OpenCombineDispatch` (the fourth one, `COpenCombineHelpers`, is considered private. Don't import it in your projects). OpenCombine itself does not have any dependencies. Not even Foundation or Dispatch. If you want to use OpenCombine with Dispatch (for example for using `DispatchQueue` as `Scheduler` for operators like `debounce`, `receive(on:)` etc.), you will need to import both `OpenCombine` and `OpenCombineDispatch`. The same applies to Foundation: if you want to use, for instance, `NotificationCenter` or `URLSession` publishers, you'll need to also import `OpenCombineFoundation`. If you develop code for multiple platforms, you may find it more convenient to import the `OpenCombineShim` module instead. It conditionally re-exports Combine on Apple platforms (if available), and all OpenCombine modules on other platforms. You can import `OpenCombineShim` only when using SwiftPM. It is not currently available for CocoaPods. ##### Swift Package Manager ###### Swift Package To add `OpenCombine` to your [SwiftPM](https://swift.org/package-manager/) package, add the `OpenCombine` package to the list of package and target dependencies in your `Package.swift` file. `OpenCombineDispatch` and `OpenCombineFoundation` products are currently not supported on WebAssembly. If your project targets WebAssembly exclusively, you should omit them from the list of your dependencies. If it targets multiple platforms including WebAssembly, depend on them only on non-WebAssembly platforms with [conditional target dependencies](https://github.com/apple/swift-evolution/blob/main/proposals/0273-swiftpm-conditional-target-dependencies.md). ```swift dependencies: [ .package(url: "https://github.com/OpenCombine/OpenCombine.git", from: "0.14.0") ], targets: [ .target( name: "MyAwesomePackage", dependencies: [ "OpenCombine", .product(name: "OpenCombineFoundation", package: "OpenCombine"), .product(name: "OpenCombineDispatch", package: "OpenCombine") ] ), ] ``` ###### Xcode `OpenCombine` can also be added as a SwiftPM dependency directly in your Xcode project *(requires Xcode 11 upwards)*. To do so, open Xcode, use **File** → **Swift Packages** → **Add Package Dependency…**, enter the [repository URL](https://github.com/OpenCombine/OpenCombine.git), choose the latest available version, and activate the checkboxes: