Swiftpack.co - Package - cx-org/CXExtensions

CXExtensions

release install platform license dicord

A collection of useful extensions for Combine and CombineX.

API

Publisher

IgnoreError

Ignore error from upstream and complete.

// Output: (data: Data, response: URLResponse), Failure: URLError
let upstream = URLSession.shared.cx.dataTaskPublisher(for: url)

// Output: (data: Data, response: URLResponse), Failure: Never
let pub = upstream.ignoreError()

Cancellable

DelayedAutoCancellable

Auto cancel after delay.

let delayedCancel = upstream
    .sink { o in
    }
    .cancel(after .second(1), scheduler: mainScheduler)

Install

Swift Package Manager

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

CocoaPods

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

Carthage

github "cx-org/CXExtensions" "master"

Use with Combine

You can change the underlying dependency to Combine by passing USE_COMBINE to the target's build configurations. For example, if you are using CocoaPods, you can modify your podfile like below:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'CXExtensions'
            target.build_configurations.each do |config|
                config.build_settings['OTHER_SWIFT_FLAGS'] = '-DUSE_COMBINE'
            end
        end
    end
end

If you are using Carthage, you should be able to use XCODE_XCCONFIG_FILE to do that.

Github

link
Stars: 2
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

0.0.1-beta.4 - Sep 11, 2019

0.0.1-beta.3 - Sep 9, 2019

0.0.1-beta.2 - Sep 9, 2019

0.0.1-beta.1 - Sep 8, 2019