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
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ People are creatures with huge visual cortexes. When we can visualize a concept
42
42
43
43
We can lift a lot of the cognitive load from trying to simulate event state machines inside every Rx operator onto high level operations over sequences.
44
44
45
-
If we don't use Rx but model asynchronous systems, that probably means that our code is full of state machines and transient states that we need to simulate instead of abstracting away.
45
+
If we don't use Rx but model asynchronous systems, that probably means our code is full of state machines and transient states that we need to simulate instead of abstracting away.
46
46
47
47
Lists and sequences are probably one of the first concepts mathematicians and programmers learn.
48
48
@@ -59,7 +59,7 @@ Another sequence, with characters:
59
59
--a--b--a--a--a---d---X // terminates with error
60
60
```
61
61
62
-
Some sequences are finite and others are infinite, like a sequence of button taps:
62
+
Some sequences are finite while others are infinite, like a sequence of button taps:
63
63
64
64
```
65
65
---tap-tap-------tap--->
@@ -100,11 +100,11 @@ protocol ObserverType {
100
100
101
101
If a sequence terminates in finite time, not calling `dispose` or not using `disposed(by: disposeBag)` won't cause any permanent resource leaks. However, those resources will be used until the sequence completes, either by finishing production of elements or returning an error.
102
102
103
-
If a sequence does not terminate in some way, resources will be allocated permanently unless `dispose` is called manually, automatically inside of a `disposeBag`, `takeUntil` or in some other way.
103
+
If a sequence does not terminate on its own, such as with a series of button taps, resources will be allocated permanently unless `dispose` is called manually, automatically inside of a `disposeBag`, with the `takeUntil` operator, or in some other way.
104
104
105
105
**Using dispose bags or `takeUntil` operator is a robust way of making sure resources are cleaned up. We recommend using them in production even if the sequences will terminate in finite time.**
106
106
107
-
In case you are curious why `Swift.Error` isn't generic, you can find explanation [here](DesignRationale.md#why-error-type-isnt-generic).
107
+
If you are curious why `Swift.Error` isn't generic, you can find the explanation [here](DesignRationale.md#why-error-type-isnt-generic).
108
108
109
109
## Disposing
110
110
@@ -135,11 +135,11 @@ This will print:
135
135
5
136
136
```
137
137
138
-
Note that you usually do not want to manually call `dispose`; this is only educational example. Calling dispose manually is usually a bad code smell. There are better ways to dispose subscriptions. We can use`DisposeBag`, the `takeUntil` operator, or some other mechanism.
138
+
Note that you usually do not want to manually call `dispose`; this is only an educational example. Calling dispose manually is usually a bad code smell. There are better ways to dispose of subscriptions such as`DisposeBag`, the `takeUntil` operator, or some other mechanism.
139
139
140
-
So can this code print something after the `dispose` call executed? The answer is: it depends.
140
+
So can this code print something after the `dispose` call is executed? The answer is: it depends.
141
141
142
-
* If the `scheduler` is a **serial scheduler** (ex. `MainScheduler`) and `dispose` is called on **on the same serial scheduler**, the answer is **no**.
142
+
* If the `scheduler` is a **serial scheduler** (ex. `MainScheduler`) and `dispose` is called **on the same serial scheduler**, the answer is **no**.
143
143
144
144
* Otherwise it is **yes**.
145
145
@@ -148,7 +148,7 @@ You can find out more about schedulers [here](Schedulers.md).
148
148
You simply have two processes happening in parallel.
149
149
150
150
* one is producing elements
151
-
* the other is disposing the subscription
151
+
* the other is disposing of the subscription
152
152
153
153
The question "Can something be printed after?" does not even make sense in the case that those processes are on different schedulers.
0 commit comments