RxAlamoRecord alternatives and similar libraries
Based on the "Reactive Programming" category.
Alternatively, view RxAlamoRecord 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. -
Katana
Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux. -
Render
UIKit a-lร SwiftUI.framework [min deployment target iOS10] -
RxCoordinator
๐ Powerful navigation library for iOS based on the coordinator pattern -
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: -
RxAutomaton
๐ค RxSwift + State Machine, inspired by Redux and Elm. -
NSObject-Rx
Handy RxSwift extensions on NSObject, including rx.disposeBag. -
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. -
STDevRxExt
STDevRxExt contains some extension functions for RxSwift and RxCocoa which makes our live easy. -
BindKit
Two-way data binding framework for iOS. Only one API to learn. -
RxOptional
RxSwift extentions for Swift optionals and "Occupiable" types
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 RxAlamoRecord or a related project?
README
Written in Swift 5
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.
Requirements
- iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+
- Xcode 10.2+
- Swift 5.1
Installation
RxAlamoRecord is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'RxAlamoRecord'
Getting Started
RxAlamoRecord can not be used without first understanding the basic principles of AlamoRecord and RxSwift. It is suggested you have a basic understanding of how both libraries work before proceeding.
Purpose
RxAlamoRecord gives you the power to bind your API reponses directly to AlamoRecordRelay
and Action
objects. Action is a powerful extension library created by the RxSwiftCommunity
AlamoRecordRelay
This object behaves exactly the same as a BehaviorRelay except that an AlamoRecordRelay
can emit an error. It is required to use an instance of an AlamoRecordRelay
when binding via RxAlamoRecord or else your app will crash if the API request returns an error or fails.
To help simplify the examples, assume these variables are included in each one:
let posts = AlamoRecordRelay<[Post]>(value: [])
let post = AlamoRecordRelay<Post?>(value: nil)
lazy var failureAction: Action<ApplicationError, Swift.Never> = {
return Action { [weak self] error in
// Do something with the error
return Observable.empty()
}
}()
Getting all instances of Post
GET
https://jsonplaceholder.typicode.com/posts
Post.rx
.all()
.execute()
.bind(to: posts, failure: failureAction)
.disposed(by: disposeBag)
Creating an instance of Post
POST
https://jsonplaceholder.typicode.com/posts
Post.rx
.create()
.withParameters(["userId": userId, "title": title, "body": body])
.execute()
.bind(to: post, failure: failureAction)
.disposed(by: disposeBag)
Finding an instance of Post
GET
https://jsonplaceholder.typicode.com/posts/1
Post.rx
.find(id: 1)
.execute()
.bind(to: post, failure: failureAction)
.disposed(by: disposeBag)
Updating an instance of Post
PUT
https://jsonplaceholder.typicode.com/posts/1
post.value?
.rx
.update()
.withParameters(["userId": userId, "title": title, "body": body])
.execute()
.bind(to: post, failure: failureAction)
.disposed(by: disposeBag)
This can also be done at the class level:
Post.rx
.update(id: 1)
.withParameters(["userId": userId, "title": title, "body": body])
.execute()
.bind(to: post, failure: failureAction)
.disposed(by: disposeBag)
Destroying an instance of Post
DELETE
https://jsonplaceholder.typicode.com/posts/1
lazy var destroyedAction: Action<Void, Swift.Never> = {
return Action { [weak self] in
// The post is now destroyed
return Observable.empty()
}
}()
post.value?
.rx
.destroy()
.execute()
.bind(to: destroyedAction, failure: failureAction)
.disposed(by: disposeBag)
This can also be done at the class level:
Post.rx
.destroy(id: 1)
.execute()
.bind(to: destroyedAction, failure: failureAction)
.disposed(by: disposeBag)
Assigning default value on failure
It is also possible to assign a default value to an AlamoRecordRelay/Action object if an API request fails:
let postTitle = AlamoRecordRelay<String?>(value: nil)
Post.rx
.find(id: 1)
.execute()
.map { $0.title }
.bind(to: postTitle, valueOnFailure: "Default Title")
.disposed(by: disposeBag)
lazy var postTitleAction: Action<String, Swift.Never> = {
return Action { [weak self] title in
// Do something with the title
return Observable.empty()
}
}()
Post.rx
.find(id: 1)
.execute()
.map { $0.title }
.bind(to: postTitleAction, valueOnFailure: "Default Title")
.disposed(by: disposeBag)
Download the example project to see just how easy creating an application with a reactive networking layer is when using RxAlamoRecord!
Author
Dalton Hinterscher, [email protected]
Credits
Reactive Logo used in header image designed by ReactiveX group
License
RxAlamoRecord is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the RxAlamoRecord README section above
are relevant to that project's source code only.