百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

rxswift-to-combine-cheatsheet

> 前端框架
开源

RxSwift 到 Apple 的 Combine 技巧表

2.1K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

RxSwift 到 Apple 的 Combine 技巧表

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 Optional.Publisher 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 allSatisfy allSatisfy amb() ❌ asObservable() eraseToAnyPublisher() asObserver() ❌ bind(to:) assign(to:on:) Assign uses a KeyPath which is really nice and useful. RxSwift needs a Binder / ObserverType to bind to. buffer buffer catch catch catchAndReturn replaceError(with:) combineLatest combineLatest, tryCombineLatest compactMap compactMap, tryCompactMap concat append, prepend concatMap ❌ contains contains count count create ❌ Apple removed AnyPublisher with a closure in Xcode 11 beta 3 :-( debounce debounce debug print deferred Deferred delay delay delaySubscription ❌ dematerialize ❌ distinctUntilChanged removeDuplicates, tryRemoveDuplicates do handleEvents element(at:) output(at:) empty Empty(completeImmediately: true) enumerated ❌ error Fail filter filter, tryFilter

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •Ruby
  • •apple
  • •combine
  • •reactive
  • •reactive-programming

> 标签

Rubyapplecombinereactivereactive-programming

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架