RxOptional alternatives and similar libraries
Based on the "Reactive Programming" category.
Alternatively, view RxOptional alternatives based on common mentions on social networks and blogs.
-
ReactiveCocoa
Cocoa framework and Obj-C dynamism bindings for ReactiveSwift. -
OpenCombine
Open source implementation of Apple's Combine framework for processing values over time. -
RxCoordinator
๐ Powerful navigation library for iOS based on the coordinator pattern -
Katana
Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux. -
RxAlamofire
RxSwift wrapper around the elegant HTTP networking in Swift Alamofire -
Interstellar
Simple and lightweight Functional Reactive Coding in Swift for the rest of us. :large_orange_diamond: -
NSObject-Rx
Handy RxSwift extensions on NSObject, including rx.disposeBag. -
RxAutomaton
๐ค RxSwift + State Machine, inspired by Redux and Elm. -
Verge
๐ฃ A robust Swift state-management framework designed for complex applications, featuring an integrated ORM for efficient data handling. -
RxMediaPicker
A reactive wrapper built around UIImagePickerController. -
VueFlux
:recycle: Unidirectional State Management Architecture for Swift - Inspired by Vuex and Flux -
Komponents ๐ฆ
๐ฆ React-inspired UIKit Components - โ ๏ธ Deprecated -
ReactiveTask
Flexible, stream-based abstraction for launching processes -
TemplateKit
React-inspired framework for building component-based user interfaces in Swift. -
RxReduce
Lightweight framework that ease the implementation of a state container pattern in a Reactive Programming compliant way. -
LightweightObservable
๐ฌ A lightweight implementation of an observable sequence that you can subscribe to. -
RxMultipeer
A testable RxSwift wrapper around MultipeerConnectivity -
Aftermath
:crystal_ball: Stateless message-driven micro-framework in Swift. -
ReactiveArray
An array class implemented in Swift that can be observed using ReactiveCocoa's Signals -
SimpleApiClient
A configurable api client based on Alamofire4 and RxSwift4 for iOS. -
OneWay
A Swift library for state management with unidirectional data flow. -
ACKReactiveExtensions
Set of useful extensions for ReactiveSwift & ReactiveCocoa -
ReactiveLocation
ReactiveCocoa wrapper for CLLocationManager. -
BindKit
Two-way data binding framework for iOS. Only one API to learn. -
STDevRxExt
STDevRxExt contains some extension functions for RxSwift and RxCocoa which makes our live easy. -
RxAlamoRecord
RxAlamoRecord combines the power of the AlamoRecord and RxSwift libraries to create a networking layer that makes interacting with API's easier than ever reactively.
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of RxOptional or a related project?
README
RxOptional
RxSwift extentions for Swift optionals and "Occupiable" types.
Usage
All operators are available on Driver as well unless otherwise marked.
Optional Operators
filterNil
Observable<String?>
.of("One", nil, "Three")
.filterNil() // Type is now Observable<String>
.subscribe { print($0) }
Next(One)
Next(Three)
Completed
replaceNilWith
Observable<String?>
.of("One", nil, "Three")
.replaceNilWith("Two") // Type is now Observable<String>
.subscribe { print($0) }
Next(One)
Next(Two)
Next(Three)
Completed
fatalErrorOnNil
During release builds fatalErrors are logged. Durring Debug builds
.fatalErrorOnNil()
sends Error event for Observables and Driver
continutes after logging fatalError.
Observable<String?>
.of("One", nil, "Three")
.fatalErrorOnNil()
.subscribe { print($0) }
Next(One)
fatal Error: Found nil while trying to unwrap type <Optional<String>>
Error(Found nil while trying to unwrap type <Optional<String>>)
errorOnNil
Unavailable on Driver. By default errors with
RxOptionalError.FoundNilWhileUnwrappingOptional
.
Observable<String?>
.of("One", nil, "Three")
.errorOnNil()
.subscribe { print($0) }
Next(One)
Error(Found nil while trying to unwrap type <Optional<String>>)
catchOnNil
Observable<String?>
.of("One", nil, "Three")
.catchOnNil {
return Observable<String>.just("A String from a new Observable")
} // Type is now Observable<String>
.subscribe { print($0) }
Next(One)
Next(A String from a new Observable)
Next(Three)
Completed
Occupiable Operators
Occupiables are:
String
Array
Dictionary
Set
Currently in Swift protocols cannot be extended to conform to other protocols.
For now the types listed above conform to Occupiable
. You can always conform
custom types to Occupiable
.
filterEmpty
Observable<[String]>
.of(["Single Element"], [], ["Two", "Elements"])
.filterEmpty()
.subscribe { print($0) }
Next(["Single Element"])
Next(["Two", "Elements"])
Completed
fatalErrorOnEmpty
During release builds fatalErrors are logged. Durring Debug builds
.fatalErrorOnEmpty()
sends Error event for Observables and Driver
continutes after logging fatalError.
Observable<[String]>
.of(["Single Element"], [], ["Two", "Elements"])
.fatalErrorOnEmpty()
.subscribe { print($0) }
Next(["Single Element"])
fatal Error: Empty occupiable of type <Array<String>>
Error(Empty occupiable of type <Array<String>>)
errorOnEmpty
By default errors with RxOptionalError.EmptyOccupiable
.
Observable<[String]>
.of(["Single Element"], [], ["Two", "Elements"])
.errorOnEmpty()
.subscribe { print($0) }
Next(["Single Element"])
Error(Empty occupiable of type <Array<String>>)
catchOnEmpty
.catchOnEmpty
guarantees that the hander function returns a Observable or Driver with
non-empty elements by calling .errorOnEmpty
or .fatalErrorOnEmpty
respectfully.
Observable<[String]>
.of(["Single Element"], [], ["Two", "Elements"])
.catchOnEmpty {
return Observable<[String]>.just(["Not Empty"])
}
.subscribe { print($0) }
Next(["Single Element"])
Next(["Not Empty"])
Next(["Two", "Elements"])
Completed
Running Examples.playground
- Run
pod install
in Example directory - Select RxOptional Examples Target
- Build
- Open Examples.playground
- Show Debug Area (cmd+shit+Y)
- Click blue play button in Debug Area
Requirements
Installation
RxOptional is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "RxOptional"
Author
Thane Gill, [email protected]
License
RxOptional is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the RxOptional README section above
are relevant to that project's source code only.