8000 GitHub - cx-org/CXExtensions at 0.0.1-beta.3
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A collection of useful extensions for Combine and CombineX

License

Notifications You must be signed in to change notification settings

cx-org/CXExtensions

Repository files navigation

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.

About

A collection of useful extensions for Combine and CombineX

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0