Skip to content

Commit

Permalink
Updates Units.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
kzaher committed Mar 12, 2017
1 parent f3a7e43 commit beb62d7
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Documentation/Units.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This document will try to describe what units are, why they are a useful concept
* [Why](#why)
* [How they work](#how-they-work)
* [Why they are named Units](#why-they-are-named-units)
* [RxSwift units](#rxswift-units)
* [RxCocoa units](#rxcocoa-units)
* [Driver unit](#driver-unit)
* [Why it's named Driver](#why-its-named-driver)
Expand Down Expand Up @@ -34,9 +35,13 @@ It's just a wrapper struct with single read only property that contains a privat

e.g.
```
struct Single<Element> {
let source: Observable<Element>
}
struct Driver<Element> {
let source: Observable<Element>
}
...
```

You can think of them as a kind of builder pattern for observable sequences. When a sequence is built, calling `.asObservable()` will transform sequence builder into a vanilla observable sequence.
Expand Down Expand Up @@ -156,10 +161,23 @@ Subscribe on main scheduler = subscribeOn(MainScheduler.instance)
Sharing side effects = share* (one of the `share` operators)
```

## RxSwift units

### Single

* Contains exactly one element

### Maybe

* Contains exactly zero or one elements

### Completeable

* Contains zero elements

## RxCocoa units

### Driver unit
### Driver

* Can't error out
* Observe on main scheduler
Expand Down

0 comments on commit beb62d7

Please sign in to comment.