You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Documentation/GettingStarted.md
+7
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ Getting Started
4
4
This project tries to be consistent with [ReactiveX.io](http://reactivex.io/). The general cross platform documentation and tutorials should also be valid in case of `RxSwift`.
1.[Creating your first `Observable` (aka observable sequence)](#creating-your-own-observable-aka-observable-sequence)
@@ -667,6 +668,12 @@ This is simply 8
667
668
...
668
669
```
669
670
671
+
## Infallible
672
+
673
+
`Infallible` is another flavor of `Observable` which is identical to it, but is guaranteed to never fail and thus cannot emit errors. This means that when creating your own `Infallible` (Using `Infallible.create` or one of the methods mentioned in [Creating your first `Observable`](#creating-your-own-observable-aka-observable-sequence)), you will not be allowed to emit errors.
674
+
675
+
`Infallible` is useful when you want to statically model and guarantee a stream of values that is known to never fail, but don't want to commit to using `MainScheduler` and don't want to implicitly use `share()` to share resources and side-effects, such as the case in [`Driver` and `Signal`](Traits.md#rxcocoa-traits).
676
+
670
677
### Life happens
671
678
672
679
So what if it's just too hard to solve some cases with custom operators? You can exit the Rx monad, perform actions in imperative world, and then tunnel results to Rx again using `Subject`s.
Copy file name to clipboardexpand all lines: README.md
+21-21
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,27 @@
1
-
<imgsrc="https://raw.githubusercontent.com/ReactiveX/RxSwift/main/assets/Rx_Logo_M.png"alt="Miss Electric Eel 2016"width="36"height="36"> RxSwift: ReactiveX for Swift
<ahref="https://cocoapods.org/pods/RxSwift"alt="RxSwift on CocoaPods"title="RxSwift on CocoaPods"><imgsrc="https://img.shields.io/cocoapods/v/RxSwift.svg" /></a>
8
+
<ahref="https://github.com/Carthage/Carthage"alt="RxSwift on Carthage"title="RxSwift on Carthage"><imgsrc="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" /></a>
9
+
<ahref="https://github.com/apple/swift-package-manager"alt="RxSwift on Swift Package Manager"title="RxSwift on Swift Package Manager"><imgsrc="https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg" /></a>
Rx is a [generic abstraction of computation](https://youtu.be/looJcaeboBY) expressed through `Observable<Element>` interface, which lets you broadcast and subscribe to values and other events from an `Observable` stream.
5
13
6
-
Rx is a [generic abstraction of computation](https://youtu.be/looJcaeboBY) expressed through `Observable<Element>` interface.
14
+
RxSwift is the Swift-specific implementation of the [Reactive Extensions](http://reactivex.io) standard.
7
15
8
-
This is a Swift version of [Rx](https://github.com/Reactive-Extensions/Rx.NET).
16
+
<palign="center"><imgsrc="assets/example.png"width="55%"alt="RxSwift Observable Example of a price constantly changing and updating the app's UI" /></p>
9
17
10
-
It tries to port as many concepts from the original version as possible, but some concepts were adapted for more pleasant and performant integration with iOS/macOS environment.
18
+
While this version aims to stay true to the original spirit and naming conventions of Rx, this projects also aims to provide a true Swift-first API for Rx APIs.
11
19
12
20
Cross platform documentation can be found on [ReactiveX.io](http://reactivex.io/).
13
21
14
-
Like the original Rx, its intention is to enable easy composition of asynchronous operations and event/data streams.
22
+
Like other Rx implementation, 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.
15
23
16
-
KVO observing, async operationsand streams are all unified under [abstraction of sequence](Documentation/GettingStarted.md#observables-aka-sequences). This is the reason why Rx is so simple, elegant and powerful.
24
+
KVO observation, async operations, UI Events and other streams of data are all unified under [abstraction of sequence](Documentation/GettingStarted.md#observables-aka-sequences). This is the reason why Rx is so simple, elegant and powerful.
17
25
18
26
## I came here because I want to ...
19
27
@@ -50,7 +58,9 @@ KVO observing, async operations and streams are all unified under [abstraction o
50
58
51
59
###### ... understand the structure
52
60
53
-
RxSwift comprises five separate components depending on each other in the following way:
61
+
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.
62
+
63
+
It comprises five separate components depending on each other in the following way:
54
64
55
65
```none
56
66
┌──────────────┐ ┌──────────────┐
@@ -71,16 +81,6 @@ RxSwift comprises five separate components depending on each other in the follow
71
81
***RxRelay**: Provides `PublishRelay`, `BehaviorRelay` and `ReplayRelay`, three [simple wrappers around Subjects](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Subjects.md#relays). It depends on `RxSwift`.
72
82
***RxTest** and **RxBlocking**: Provides testing capabilities for Rx-based systems. It depends on `RxSwift`.
73
83
74
-
###### ... find compatible
75
-
76
-
* libraries from [RxSwiftCommunity](https://github.com/RxSwiftCommunity).
77
-
*[Pods using RxSwift](https://cocoapods.org/?q=uses%3Arxswift).
78
-
79
-
###### ... see the broader vision
80
-
81
-
* Does this exist for Android? [RxJava](https://github.com/ReactiveX/RxJava)
82
-
* Where is all of this going, what is the future, what about reactive architectures, how do you design entire apps this way? [Cycle.js](https://github.com/cyclejs/cycle-core) - this is javascript, but [RxJS](https://github.com/Reactive-Extensions/RxJS) is javascript version of Rx.
> **Note**: There is a critical cross-dependency bug affecting many projects including RxSwift in Swift Package Manager. We've [filed a bug (SR-12303)](https://bugs.swift.org/browse/SR-12303) in early 2020 but have eno answer yet. Your mileage may vary.
199
+
> **Note**: There is a critical cross-dependency bug affecting many projects including RxSwift in Swift Package Manager. We've [filed a bug (SR-12303)](https://bugs.swift.org/browse/SR-12303) in early 2020 but have no answer yet. Your mileage may vary. A partial workaround can be found [here](https://github.com/ReactiveX/RxSwift/issues/2127#issuecomment-717830502).
0 commit comments