RxAutomaton alternatives and similar libraries
Based on the "Reactive Programming" category.
Alternatively, view RxAutomaton 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: -
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. -
STDevRxExt
STDevRxExt contains some extension functions for RxSwift and RxCocoa which makes our live easy. -
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 RxAutomaton or a related project?
README
RxAutomaton
RxSwift port of ReactiveAutomaton (State Machine).
Terminology
Whenever the word "signal" or "(signal) producer" appears (derived from ReactiveCocoa), they mean "hot-observable" and "cold-observable".
Example
(Demo app is bundled in the project)
[](Assets/login-diagram.png)
To make a state transition diagram like above with additional effects, follow these steps:
// 1. Define `State`s and `Input`s.
enum State {
case loggedOut, loggingIn, loggedIn, loggingOut
}
enum Input {
case login, loginOK, logout, logoutOK
case forceLogout
}
// Additional effects (`Observable`s) while state-transitioning.
// (NOTE: Use `Observable.empty()` for no effect)
let loginOKProducer = /* show UI, setup DB, request APIs, ..., and send `Input.loginOK` */
let logoutOKProducer = /* show UI, clear cache, cancel APIs, ..., and send `Input.logoutOK` */
let forcelogoutOKProducer = /* do something more special, ..., and send `Input.logoutOK` */
let canForceLogout: State -> Bool = [.loggingIn, .loggedIn].contains
// 2. Setup state-transition mappings.
let mappings: [Automaton<State, Input>.EffectMapping] = [
/* Input | fromState => toState | Effect */
/* ----------------------------------------------------------------*/
.login | .loggedOut => .loggingIn | loginOKProducer,
.loginOK | .loggingIn => .loggedIn | .empty(),
.logout | .loggedIn => .loggingOut | logoutOKProducer,
.logoutOK | .loggingOut => .loggedOut | .empty(),
.forceLogout | canForceLogout => .loggingOut | forceLogoutOKProducer
]
// 3. Prepare input pipe for sending `Input` to `Automaton`.
let (inputSignal, inputObserver) = Observable<Input>.pipe()
// 4. Setup `Automaton`.
let automaton = Automaton(
state: .loggedOut,
input: inputSignal,
mapping: reduce(mappings), // combine mappings using `reduce` helper
strategy: .latest // NOTE: `.latest` cancels previous running effect
)
// Observe state-transition replies (`.success` or `.failure`).
automaton.replies.subscribe(next: { reply in
print("received reply = \(reply)")
})
// Observe current state changes.
automaton.state.asObservable().subscribe(next: { state in
print("current state = \(state)")
})
And let's test!
let send = inputObserver.onNext
expect(automaton.state.value) == .loggedIn // already logged in
send(Input.logout)
expect(automaton.state.value) == .loggingOut // logging out...
// `logoutOKProducer` will automatically send `Input.logoutOK` later
// and transit to `State.loggedOut`.
expect(automaton.state.value) == .loggedOut // already logged out
send(Input.login)
expect(automaton.state.value) == .loggingIn // logging in...
// `loginOKProducer` will automatically send `Input.loginOK` later
// and transit to `State.loggedIn`.
// ๐จ๐ฝ < But wait, there's more!
// Let's send `Input.forceLogout` immediately after `State.loggingIn`.
send(Input.forceLogout) // ๐ฅ๐ฃ๐ฅ
expect(automaton.state.value) == .loggingOut // logging out...
// `forcelogoutOKProducer` will automatically send `Input.logoutOK` later
// and transit to `State.loggedOut`.
License
[MIT](LICENSE)
*Note that all licence references and agreements mentioned in the RxAutomaton README section above
are relevant to that project's source code only.