Skip to content

Commit

Permalink
corrected the source tag
Browse files Browse the repository at this point in the history
  • Loading branch information
antonarhipov committed Feb 2, 2021
1 parent de1ef41 commit 7e95f64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ interface MessageService {

Now we can connect the dots and update the `PersistentMessageService` class to integrate the above changes.

[source]
[source,kotlin]
-----
import com.example.kotlin.chat.asDomainObject
import com.example.kotlin.chat.asRendered
Expand Down Expand Up @@ -1192,7 +1192,7 @@ class PersistentMessageService(val messageRepository: MessageRepository) : Messa

First, since the `MessageService` interface has been changed, we need to update the method signatures in the corresponding implementation. Consequently, the `mapToViewModel `extension method that we defined previously in the `Extension.kt` file for the `List` type is now needed for the `Flow` type, instead.

[source]
[source,kotlin]
-----
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
Expand All @@ -1202,7 +1202,7 @@ fun Flow<Message>.mapToViewModel(): Flow<MessageVM> = map { it.asViewModel() }

For better readability we also added the `asRendered` extension function for the MessageVM class. In `Extensions.kt` file:

[source]
[source,kotlin]
-----
fun MessageVM.asRendered(contentType: ContentType = ContentType.MARKDOWN): MessageVM =
this.copy(content = contentType.render(this.content))
Expand Down

0 comments on commit 7e95f64

Please sign in to comment.