Skip to content

Commit 872c00a

Browse files
authored
Update example for RxKotlin 2.0
1 parent 28db815 commit 872c00a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ RxKotlin is a lightweight library that adds convenient extension functions to [R
66

77

88
```kotlin
9-
package rx.lang.kotlin
10-
11-
import rx.Observable
9+
import io.reactivex.rxkotlin.subscribeBy
10+
import io.reactivex.rxkotlin.toObservable
1211

1312
fun main(args: Array<String>) {
1413

@@ -17,9 +16,9 @@ fun main(args: Array<String>) {
1716
list.toObservable() // extension function for Iterables
1817
.filter { it.length >= 5 }
1918
.subscribeBy( // named arguments for lambda Subscribers
20-
onNext = { println(it) },
21-
onError = { it.printStackTrace() },
22-
onComplete = { println("Done!") }
19+
onNext = { println(it) },
20+
onError = { it.printStackTrace() },
21+
onComplete = { println("Done!") }
2322
)
2423

2524
}

0 commit comments

Comments
 (0)