24.6k sao GitHub và vẫn tăng — ReactiveX/RxSwift là dự án Swift mà TopGit đang theo dõi trên nền tảng. Reactive Programming in Swift
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Rx is a generic abstraction of computation expressed through Observable<Element> interface, which lets you broadcast and subscribe to values and other events from an Observable stream.
RxSwift is the Swift-specific implementation of the Reactive Extensions standard.
While this version aims to stay true to the original spirit and naming conventions of Rx, this project also aims to provide a true Swift-first API for Rx APIs.
Cross platform documentation can be found on ReactiveX.io.
Like other Rx implementations, RxSwift's intention is to enable easy composition of asynchronous operations and streams of data in the form of Observable objects and a suite of methods to transform and compose these pieces of asynchronous work.
KVO observation, async operations, UI Events and other streams of data are all unified under abstraction of sequence. This is the reason why Rx is so simple, elegant and powerful.
I came here because I want to ...
... understand
why use rx?
the basics, getting started with RxSwift
traits - what are Single, Completable, Maybe, Driver, and ControlProperty ... and why do they exist?
testing
tips and common errors
debugging
the math behind Rx
what are hot and cold observable sequences?
... install
Integrate RxSwift/RxCocoa with my app. Installation Guide
... hack around
with the example app. Running Example App
with operators in playgrounds. Playgrounds
... interact
All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences. Join Slack Channel
Report a problem using the library. Open an Issue With Bug Template
Request a new feature. Open an Issue With Feature Request Template
Help out Check out contribution guide
... compare
with Combine and ReactiveSwift.
... understand the structure
RxSwift is as compositional as the asynchronous work it drives. The core unit is RxSwift itself, while other dependencies can be added for UI Work, testing, and more.
It comprises five separate components depending on each other in the following way:
RxSwift: The core of RxSwift, providing the Rx standard as (mostly) defined by ReactiveX. It has no other dependencies.
RxCocoa: Provides Cocoa-specific capabilities for general iOS/macOS/watchOS & tvOS app development, such as Shared Sequences, Traits, and much more. It depends on both RxSwift and RxRelay.
RxRelay: Provides PublishRelay, BehaviorRelay and ReplayRelay, three simple wrappers around Subjects. It depends on RxSwift.
RxTest and RxBlocking: Provides testing capabilities for Rx-based systems. It depends on RxSwift.
Usage
Here's an example
In Action
Define search for GitHub repositories ...
let searchResults = searchBar.rx.text.orEmpty
.throttle(.milliseconds(300), scheduler: MainScheduler.instance)
.distinctUntilChanged()
.flatMapLatest { query -> Observable<[Repository]> in
if query.isEmpty {
return .just([])
}
return searchGitHub(query)
.catchAndReturn([])
}
.observe(on: MainScheduler.instance)
RxSwift doesn't contain any external dependencies.
These are currently the supported installation options:
Manual
Open Rx.xcworkspace, choose RxExample and hit run. This method will build everything and run the sample app
XCFrameworks
Each release starting with RxSwift 6 includes *.xcframework framework binaries.
Simply drag the needed framework binaries to your Frameworks, Libraries, and Embedded Content section under your target's General tab.
[!TIP]
RxSwift's xcframework(s) are signed with an Apple Developer account, and you can always verify the Team Name: Shai Mishali
Carthage
Add this to Cartfile
github "ReactiveX/RxSwift" "6.10.0"
$ carthage update
Carthage as a Static Library
Carthage defaults to building RxSwift as a Dynamic Library.
If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage:
Note: There is a critical cross-dependency bug affecting many projects including RxSwift in Swift Package Manager. We've filed a bug (SR-12303) in early 2020 but have no answer yet. Your mileage may vary. A partial workaround can be found here.
ReactiveX/RxSwift thuộc nhóm Mobile trên TopGit, cùng 8 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về ReactiveX/RxSwift ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/ReactiveX/RxSwift là nguồn chính thức.
ReactiveX/RxSwift có bao nhiêu sao?
ReactiveX/RxSwift có 24.6k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/ReactiveX/RxSwift. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
ReactiveX/RxSwift có những chủ đề gì?
GitHub topics của ReactiveX/RxSwift: "functional", "ios", "observer", "reactive", "reactivex", "rxswift", "swift", "unidirectional". TopGit xếp repo vào nhóm Mobile.
ReactiveX/RxSwift còn đang phát triển không?
Commit gần nhất trên ReactiveX/RxSwift là 2 tháng trước (theo timestamp GitHub). Repo có 4.1k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
ReactiveX/RxSwift viết bằng ngôn ngữ gì?
ReactiveX/RxSwift chủ yếu viết bằng Swift. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Vì sao ReactiveX/RxSwift được xếp vào nhóm Mobile?
TopGit xếp ReactiveX/RxSwift vào nhóm Mobile dựa trên GitHub topics và mô tả của repo (gắn thẻ: "functional", "ios", "observer"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về RxSwift?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về RxSwift.