Skip to content

Commit d794c9d

Browse files
committed
Update examples
1 parent fec9b2a commit d794c9d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private fun startLongAsyncOperation(v: Int) =
2121
}
2222

2323
fun main(args: Array<String>) {
24-
val future = async<String> {
24+
val future = async {
2525
(1..5).map {
2626
await(startLongAsyncOperation(it))
2727
}.joinToString("\n")
@@ -39,7 +39,7 @@ it will not work with earlier versions.
3939
import kotlinx.coroutines.generate
4040

4141
fun main(args: Array<String>) {
42-
val sequence = generate<Int> {
42+
val sequence = generate {
4343
for (i in 1..5) {
4444
yield(i)
4545
}
@@ -75,7 +75,7 @@ fun main(args: Array<String>) {
7575

7676
val github = retrofit.create(GitHub::class.java)
7777

78-
asyncRx<Unit> {
78+
asyncRx {
7979
for (org in listOf("Kotlin", "ReactiveX")) {
8080
// `awaitSingle()` call here is a suspension point,
8181
// i.e. coroutine's code stops on it until request is not completed

kotlinx-coroutines-rx-example/src/main/kotlin/main.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fun main(args: Array<String>) {
4242

4343
val otherRepos =
4444
github.listRepos(name).awaitSingle()
45-
.map { it.name }.joinToString(", ")
45+
.map(Repo::name).joinToString(", ")
4646

4747
println(otherRepos)
4848
}

0 commit comments

Comments
 (0)