Skip to content
CombineX + Foundation
Swift Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CXFoundation.xcodeproj
Sources/CXFoundation
Tests
.gitignore
.travis.yml
CXFoundation.podspec
Cartfile
LICENSE
Package.resolved
Package.swift
README.md
README.zh_cn.md

README.md

CXFoundation(中文)

travis release install platform license dicord

CombineX + Foundation

Notice

This library is still in beta, so do not use it in production!

🐱

Support

  • iOS 8+ / macOS 10.10+ / tvOS 9+ / watchOS 2+
  • Linux - Ubuntu 16.04

API

Timer

let ping = Timer.cx.publish(every: 1, on: RunLoop.main, in: .default)
    .sink { date in 
        // ping
    }

URLSession

let request = URLSession.shared.cx.dataTaskPublisher(for: host)
    .sink { (data, response) in
        // update ui
    }

NotificationCenter

let observe = NotificationCenter.default.cx.publisher(for: name)
    .sink { notification in
        // 
    }

Scheduler

let sink = upstream
    .receive(on: RunLoop.main.cx)
    .sink { v in
        //
    }

Coder

let sink = upstream
    .map(JSONEncoder().cx)
    .sink { user in
        //
    }

Related Projects

Installation

Swift Package Manager

dependencies.append(
    .package(url: "https://github.com/cx-org/CXFoundation", .branch("master"))
)

CocoaPods

pod 'CxFoundation', :git => 'https://github.com/cx-org/CXFoundation.git', :branch => 'master'

Carthage

github "cx-org/CXFoundation" "master"

FAQ

What's Combine and CombineX

Check here.

Why are the interfaces not exactly the same as Combine?

Check here

If the interfaces are inconsistent, will migration be very troublesome?

CXCompatible can help you migrate painlessly.

You can’t perform that action at this time.