Skip to content

Commit 8735a75

Browse files
committed
Documentation fixes.
1 parent f115799 commit 8735a75

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Documentation/Traits.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ A simple example would look like this:
6565

6666
```swift
6767
func getRepo(_ repo: String) -> Single<[String: Any]> {
68-
return Single.create { single in
68+
return Single<[String: Any]>.create { single in
6969
let task = URLSession.shared.dataTask(with: URL(string: "https://api.github.com/repos/\(repo)")!) { data, _, error in
7070
if let error = error {
7171
single(.error(error))
@@ -195,7 +195,7 @@ Creating a Maybe is similar to creating an Observable. A simple example would lo
195195

196196
```swift
197197
func generateString() -> Maybe<String> {
198-
return Maybe.create { maybe in
198+
return Maybe<String>.create { maybe in
199199
maybe(.success("RxSwift"))
200200

201201
// OR

Documentation/Why.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
```swift
88
Observable.combineLatest(firstName.rx.text, lastName.rx.text) { $0 + " " + $1 }
99
.map { "Greetings, \($0)" }
10-
.bindTo(greetingLabel.rx.text)
10+
.bind(to: greetingLabel.rx.text)
1111
```
1212

1313
This also works with `UITableView`s and `UICollectionView`s.
1414

1515
```swift
1616
viewModel
1717
.rows
18-
.bindTo(resultsTableView.rx.items(cellIdentifier: "WikipediaSearchCell", cellType: WikipediaSearchCell.self)) { (_, viewModel, cell) in
18+
.bind(to: resultsTableView.rx.items(cellIdentifier: "WikipediaSearchCell", cellType: WikipediaSearchCell.self)) { (_, viewModel, cell) in
1919
cell.title = viewModel.title
2020
cell.url = viewModel.url
2121
}
@@ -61,7 +61,7 @@ public func scrollViewDidScroll(scrollView: UIScrollView) { [weak self] // what
6161
self.resultsTableView
6262
.rx.contentOffset
6363
.map { $0.x }
64-
.bindTo(self.leftPositionConstraint.rx.constant)
64+
.bind(to: self.leftPositionConstraint.rx.constant)
6565
```
6666

6767
### KVO

0 commit comments

Comments
 (0)