android / codelab-kotlin-coroutines

Kotlin Coroutines codelab
Apache License 2.0
552 stars 268 forks source link

minor typo in codelabs #63

Closed kklyoon closed 4 years ago

kklyoon commented 4 years ago

https://codelabs.developers.google.com/codelabs/kotlin-coroutines/index.html?index=..%2F..index#7

This function does quite a few things in order to implement the refresh.

1. Switch to another thread with BACKGROUND ExecutorService
2. Run the fetchNewTitle network request using the blocking execute() method. This will run the network request in the current thread, in this case one of the threads in BACKGROUND.
3. If the result is successful, save it to the database with insertTitle and call the onCompleted() method.
4. If the result was not successful, or there is an exception, call the onError method to tell the caller about the failed refresh.

as second clause "Run the fetchNewTitle network ..." the method name is "fetchNewTitle" -> "fetchNextTitle" in code.

kklyoon commented 4 years ago

more typo issues in below page

https://codelabs.developers.google.com/codelabs/kotlin-coroutines/index.html?index=..%2F..index#8

TestingFakes.kt

(...)

MainNetworkFake

  1. Replace fetchTitle fetchNextTitle with this function

fun fetchTitle() = result override suspend fun fetchNextTitle() = result

MainNetworkCompletableFake

  1. Replace fetchTitle fetchNextTitle with this function

fun fetchTitle() = completable.await() override suspend fun fetchNextTitle(): String = completable.await()

tiembo commented 4 years ago

Hi @kklyoon , thanks for the typo fixes! We've made these changes, which will be reflected in the codelab during the next publish cycle.