Latest 0.1.1
Homepage https://github.com/briansemiglia/RxCallbacks
License MIT
Platforms ios 8.0
Dependencies RxSwift
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

// Only argument
Observable<Void>
    .fromCallback(PHPhotoLibrary.shared().performChangesAndWait)
    .subscribe(onNext: { })
    .disposed(by: DisposeBag())

// Tail of n arguments
Observable<(Bool, Error?)>
    .fromCallback(curry(PHPhotoLibrary.shared().performChanges)({ /* changes */ }))
    .subscribe(onNext: { success, error in })
    .disposed(by: DisposeBag())

// Functions that accept completion handlers AND return non-void types aren't compatible
Observable<Void>
    .fromCallback(curry(URLSession.shared().dataTask)(URL(string: "")!))
    .subscribe(onNext: { })
    .disposed(by: DisposeBag())

Installation

RxCallbacks is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'RxCallbacks'

Author

[email protected]

License

RxCallbacks is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "RxCallbacks",
    "version": "0.1.1",
    "summary": "An RxSwift extension for converting callbacks to observables.",
    "description": "Convert callback closures to observables using the provided static `fromCallback function.",
    "homepage": "https://github.com/briansemiglia/RxCallbacks",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "[email protected]": "[email protected]"
    },
    "source": {
        "git": "https://github.com/briansemiglia/RxCallbacks.git",
        "tag": "0.1.1"
    },
    "social_media_url": "https://twitter.com/brians_",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "RxCallbacks/Classes/**/*",
    "swift_version": "4.2",
    "dependencies": {
        "RxSwift": [
            "~> 4.4.0"
        ]
    }
}

Pin It on Pinterest

Share This