Swiftpack.co - Package - cx-org/CXFoundation

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.

Github

link
Stars: 3
Help us keep the lights on

Dependencies

Used By

Total: 1

Releases

0.0.1-beta.5 - Sep 11, 2019

0.0.1-beta.4 - Sep 10, 2019

0.0.1-beta.3 - Sep 7, 2019

0.0.1-beta.2 - Aug 18, 2019