CombineCommunity / Rxswift To Combine Cheatsheet
Licence: mit
RxSwift to Apple’s Combine Cheat Sheet
Stars: ✭ 1,040
Programming Languages
ruby
36898 projects - #4 most used programming language
Projects that are alternatives of or similar to Rxswift To Combine Cheatsheet
Mp3ID3Tagger
🎶🎵A macOS application to edit the ID3 tag of your mp3 files. Developed with RxSwift and RxCocoa. 🎸🎼
Stars: ✭ 17 (-98.37%)
Mutual labels: reactive, rxswift, reactive-programming
SwiftObserver
Elegant Reactive Primitives for Clean Swift Architecture #NoRx
Stars: ✭ 14 (-98.65%)
Mutual labels: reactive, rxswift, reactive-programming
Swiftrex
Swift + Redux + (Combine|RxSwift|ReactiveSwift) -> SwiftRex
Stars: ✭ 267 (-74.33%)
Mutual labels: apple, reactive-programming, rxswift
Rxcombine
Bi-directional type bridging between RxSwift and Apple's Combine framework
Stars: ✭ 741 (-28.75%)
Mutual labels: reactive, reactive-programming, rxswift
Entwine
Testing tools and utilities for Apple's Combine framework.
Stars: ✭ 306 (-70.58%)
Mutual labels: apple, reactive, reactive-programming
Fluxxkit
Unidirectional data flow for reactive programming in iOS.
Stars: ✭ 42 (-95.96%)
Mutual labels: reactive-programming, rxswift
Inferno Most Fp Demo
A demo for the ReactJS Tampa Bay meetup showing how to build a React+Redux-like architecture from scratch using Inferno, Most.js, reactive programmning, and various functional programming tools & techniques
Stars: ✭ 45 (-95.67%)
Mutual labels: reactive, reactive-programming
Motion
Reactive frontend UI components for Rails in pure Ruby
Stars: ✭ 498 (-52.12%)
Mutual labels: reactive, reactive-programming
Awesome Rxjs
A collection of awesome RxJS resources
Stars: ✭ 314 (-69.81%)
Mutual labels: reactive, reactive-programming
Rxjava2 Jdbc
RxJava2 integration with JDBC including Non-blocking Connection Pools
Stars: ✭ 360 (-65.38%)
Mutual labels: reactive, reactive-programming
Reactivemanifesto
The Reactive Manifesto
Stars: ✭ 542 (-47.88%)
Mutual labels: reactive, reactive-programming
Reactive Practice At Taobao
♨️ Reactive @ 淘宝 | Reactive实践、推动、落地的记录与大会分享 | Flow Arch(流式架构)/Reactive Programming(RP/反应式编程)
Stars: ✭ 314 (-69.81%)
Mutual labels: reactive, reactive-programming
Rxrealm
RxSwift extension for RealmSwift's types
Stars: ✭ 1,007 (-3.17%)
Mutual labels: reactive, rxswift
Vueflux
♻️ Unidirectional State Management Architecture for Swift - Inspired by Vuex and Flux
Stars: ✭ 315 (-69.71%)
Mutual labels: reactive, reactive-programming
Open Source Ios Apps
📱 Collaborative List of Open-Source iOS Apps
Stars: ✭ 28,826 (+2671.73%)
Mutual labels: apple, reactive-programming
Toy Rx
A tiny implementation of RxJS that actually works, for learning
Stars: ✭ 290 (-72.12%)
Mutual labels: reactive, reactive-programming
RxSwift to Combine Cheatsheet
This is a Cheatsheet for RxSwift developers interested in Apple's new Combine framework.
It's based on the following blog post: https://medium.com/gett-engineering/rxswift-to-apples-combine-cheat-sheet-e9ce32b14c5b
Basics
RxSwift | Combine | |
---|---|---|
Deployment Target | iOS 8.0+ | iOS 13.0+ |
Platforms supported | iOS, macOS, tvOS, watchOS, Linux | iOS, macOS, tvOS, watchOS, UIKit for Mac ¹ |
Spec | Reactive Extensions (ReactiveX) | Reactive Streams (+ adjustments) |
Framework Consumption | Third-party | First-party (built-in) |
Maintained by | Open-Source / Community | Apple |
UI Bindings | RxCocoa | SwiftUI ² |
Core Components
RxSwift | Combine | Notes |
---|---|---|
AnyObserver | AnySubscriber | |
BehaviorRelay | ❌ | Simple wrapper around BehaviorSubject, could be easily recreated in Combine |
BehaviorSubject | CurrentValueSubject | This seems to be the type that holds @State under the hood |
Completable | ❌ | |
CompositeDisposable | ❌ | |
ConnectableObservableType | ConnectablePublisher | |
Disposable | Cancellable | |
DisposeBag | A collection of AnyCancellables | Call anyCancellable.store(in: &collection), where collection can be an array, a set, or any other RangeReplaceableCollection |
Driver | ObservableObject | Both guarantee no failure, but Driver guarantees delivery on Main Thread. In Combine, SwiftUI recreates the entire view hierarachy on the Main Thread, instead. |
Maybe | Publishers.Optional | |
Observable | Publisher | |
Observer | Subscriber | |
PublishRelay | ❌ | Simple wrapper around PublishSubject, could be easily recreated in Combine |
PublishSubject | PassthroughSubject | |
ReplaySubject | ❌ | |
ScheduledDisposable | ❌ | |
SchedulerType | Scheduler | |
SerialDisposable | ❌ | |
Signal | ❌ | |
Single | Deferred + Future | Future has to be wrapped in a Deferred, or its greedy as opposed to Single's laziness |
SubjectType | Subject | |
TestScheduler | ❌ | There doesn't seem to be an existing testing scheduler for Combine code |
Operators
RxSwift | Combine | Notes |
---|---|---|
amb() | ❌ | |
asObservable() | eraseToAnyPublisher() | |
asObserver() | ❌ | |
bind(to:) | assign(to🔛) |
Assign uses a KeyPath which is really nice and useful. RxSwift needs a Binder / ObserverType to bind to. |
buffer | buffer | |
catchError | catch | |
catchErrorJustReturn | replaceError(with:) | |
combineLatest | combineLatest, tryCombineLatest | |
compactMap | compactMap, tryCompactMap | |
concat | append, prepend | |
concatMap | ❌ | |
create | ❌ | Apple removed AnyPublisher with a closure in Xcode 11 beta 3 :-( |
debounce | debounce | |
debug | ||
deferred | Deferred | |
delay | delay | |
delaySubscription | ❌ | |
dematerialize | ❌ | |
distinctUntilChanged | removeDuplicates, tryRemoveDuplicates | |
do | handleEvents | |
elementAt | output(at:) | |
empty | Empty(completeImmediately: true) | |
enumerated | ❌ | |
error | Fail | |
filter | filter, tryFilter | |
first | first, tryFirst | |
flatMap | flatMap | |
flatMapFirst | ❌ | |
flatMapLatest | switchToLatest | |
from(optional:) | Optional.Publisher(_ output:) | |
groupBy | ❌ | |
ifEmpty(default:) | replaceEmpty(with:) | |
ifEmpty(switchTo:) | ❌ | Could be achieved with composition - replaceEmpty(with: publisher).switchToLatest() |
ignoreElements | ignoreOutput | |
interval | ❌ | |
just | Just | |
map | map, tryMap | |
materialize | ❌ | |
merge | merge, tryMerge | |
merge(maxConcurrent:) | flatMap(maxPublishers:) | |
multicast | multicast | |
never | Empty(completeImmediately: false) | |
observeOn | receive(on:) | |
of | Sequence.publisher |
publisher property on any Sequence or you can use Publishers.Sequence(sequence:) directly |
publish | makeConnectable | |
range | ❌ | |
reduce | reduce, tryReduce | |
refCount | autoconnect | |
repeatElement | ❌ | |
retry, retry(3) | retry, retry(3) | |
retryWhen | ❌ | |
sample | ❌ | |
scan | scan, tryScan | |
share | share | There’s no replay or scope in Combine. Could be “faked” with multicast. |
skip(3) | dropFirst(3) | |
skipUntil | drop(untilOutputFrom:) | |
skipWhile | drop(while:), tryDrop(while:) | |
startWith | prepend | |
subscribe | sink | |
subscribeOn | subscribe(on:) | RxSwift uses Schedulers. Combine uses RunLoop, DispatchQueue, and OperationQueue. |
take(1) | prefix(1) | |
takeLast | last | |
takeUntil | prefix(untilOutputFrom:) | |
throttle | throttle | |
timeout | timeout | |
timer | Timer.publish | |
toArray() | collect() | |
window | collect(Publishers.TimeGroupingStrategy) | Combine has a TimeGroupingStrategy.byTimeOrCount that could be used as a window. |
withLatestFrom | ❌ | |
zip | zip |
Contributing
Add any data/operators to the appropriate CSV files in the Data folder, run bundle install
and generate.rb
.
Finally, commit the changes and submit a Pull Request.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].