STDevRxExt alternatives and similar libraries
Based on the "Reactive Programming" category.
Alternatively, view STDevRxExt alternatives based on common mentions on social networks and blogs.
-
JASONETTE-iOS
Native App over HTTP. Create your own native iOS app with nothing but JSON. -
ReactiveSwift
Streams of values over time by ReactiveCocoa group -
RxAlamofire
RxSwift wrapper around the elegant HTTP networking in Swift Alamofire -
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. -
ReactiveKit
ReactiveKit is a collection of Swift frameworks for reactive and functional reactive programming. -
Interstellar
Simple and lightweight Functional Reactive Coding in Swift for the rest of us. :large_orange_diamond: -
RxAutomaton
RxSwift + State Machine, inspired by Redux and Elm. -
NSObject-Rx
Handy RxSwift extensions on NSObject, including rx_disposeBag. -
Hanson
Lightweight observations and bindings in Swift, with support for KVO and NotificationCenter. -
RxMediaPicker
A reactive wrapper built around UIImagePickerController. -
VueFlux
Unidirectional Data Flow State Management Architecture for Swift -
ReactiveCoreData
ReactiveCoreData (RCD) is an attempt to bring Core Data into the ReactiveCocoa (RAC) world. -
Verge
Verge is a faster and scalable state management library for UIKit and SwiftUI -
Reactor
๐ Unidirectional Data Flow using idiomatic Swift-inspired by Elm and Redux . -
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 -
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. -
ACKReactiveExtensions
Useful extensions for ReactiveCocoa -
Bindy
Simple, lightweight swift bindings with KVO support and easy to read syntax. -
BindKit
Two-way data binding framework for iOS. Only one API to learn. -
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. -
RxOptional
RxSwift extentions for Swift optionals and "Occupiable" types -
Tokamak
React-like framework providing a declarative API for building native UI components with easy to use one-way data binding.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of STDevRxExt or a related project?
README
STDevRxExt
Example
To run the [Example.playground](Example/Example.playground), clone the repo, and run pod install
from the Example directory first.
Requirements
- iOS 8.0+
- tvOS 9.0+
- macOS 10.10+
- watchOS 3.0+
- Swift 5.0+
- Xcode 11+
Installation
CocoaPods STDevRxExt is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'STDevRxExt'
Swift Package Manager You can use The Swift Package Manager to install STDevRxExt by adding the proper description to your Package.swift file:
import PackageDescription
let package = Package( name: "YOUR_PROJECT_NAME", targets: [], dependencies: [ .package(url: "https://github.com/STDevTM/STDevRxExt.git", from: "1.0.0") ] )
Next, add STDevRxExt to your targets dependencies like so: .target( name: "YOUR_TARGET_NAME", dependencies: [ "STDevRxExt", ] ), Then run swift package update.
List of All Extensions
- Filter Extensions
- Map Extensions
- Cast Extensions
- Other Extensions
- more coming soon
Filter Extensions
Allow only true
elements from Observable<Bool>
:
let disposeBag = DisposeBag()
Observable.of(true, false, false, true, true)
.allowTrue()
.subscribe(onNext: { print($0) })
.disposed(by: disposeBag)
Output will be:
true
true
true
You can use allowTrue
on Bool?
as well. In this case nil
elements will be ignored:
let disposeBag = DisposeBag()
Observable.of(true, false, nil, true, nil, true)
.allowTrue()
.subscribe(onNext: { print($0) })
.disposed(by: disposeBag)
Output will be:
true
true
true
If you prefer to allow nil
elements as well then you can use allowTrueOrNil
like this:
let disposeBag = DisposeBag()
Observable.of(true, false, nil, true, nil, true, false)
.allowTrueOrNil()
.subscribe(onNext: { print($0) })
.disposed(by: disposeBag)
Output will be:
true
true
true
true
true
Map Extensions
You can map every element in sequence with provided value.
let disposeBag = DisposeBag()
Observable.of(1, 5, 7, 8)
.map(to: "ping")
.subscribe(onNext: { print($0) })
.disposed(by: disposeBag)
Output will be:
ping
ping
ping
ping
You can map every element in sequence by procided Key Path.
let disposeBag = DisposeBag()
let observable = Observable.of(
Book(title: "Twenty Thousand Leagues Under the Sea", author: Author("Jules", "Verne")),
Book(title: "Hamlet", author: Author("William", "Shakespeare")),
Book(title: "Hearts of Three", author: Author("Jack", "London"))
)
observable
.map(at: \.title)
.subscribe(onNext: { print($0) })
.disposed(by: disposeBag)
observable
.map(at: \.author.firstName)
.subscribe(onNext: { print($0) })
.disposed(by: disposeBag)
Output will be:
Twenty Thousand Leagues Under the Sea
Hamlet
Hearts of Three
Jules
William
Jack
Cast Extensions
You can do downcast elements in sequence using cast(to:)
.
let disposeBag = DisposeBag()
Observable<CustomStringConvertible>.of("1", "5", "7", "8")
.cast(to: String.self)
.subscribe(onNext: { print($0) })
.disposed(by: disposeBag)
Output will be:
Optional("1")
Optional("5")
Optional("7")
Optional("8")
In order to do force downcast use forceCast(to:)
liek this:
let disposeBag = DisposeBag()
Observable<CustomStringConvertible>.of("1", "5", "7", "8")
.forceCast(to: String.self)
.subscribe(onNext: { print($0) })
.disposed(by: disposeBag)
Output will be:
1
5
7
8
In case of downcast exception it will return Observable.error(RxCastError.castFailed)
.
Allow extension functions can be used on Driver
as well, except forceCast(to:)
.
Other Extensions
Sometimes we need to update some subject or observer on each next
event of Observable
or Driver
. For example:
request
.do(onNext: { [weak self] _ in
self?.inProgress.onNext(true)
})
.flatMap {
service.doRequest($0)
}
.do(onNext: { [weak self] _ in
self?.inProgress.onNext(false)
})
.subscribe(onNext: { response in
dump(response)
})
.disposed(by: disposeBag)
You can use update(_:with:)
method for shorting code like this:
request
.update(inProgress, with: true)
.flatMap {
service.doRequest($0)
}
.update(inProgress, with: false)
.subscribe(onNext: { response in
dump(response)
})
.disposed(by: disposeBag)
Author
Tigran Hambardzumyan, [email protected]
Support
Feel free to open issues with any suggestions, bug reports, feature requests, questions.
Let us know!
Weโd be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion.
License
STDevRxExt is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the STDevRxExt README section above
are relevant to that project's source code only.