Skip to content

Instantly share code, notes, and snippets.

@1gravity
Created March 23, 2022 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1gravity/e234aca0ccde464286f380fb4dc02e8c to your computer and use it in GitHub Desktop.
Save 1gravity/e234aca0ccde464286f380fb4dc02e8c to your computer and use it in GitHub Desktop.
Functional Kotlin Example
binding {
val postData = networkDataSource.getPost(id).bind()
val comments = networkDataSource.getComments().bind()
.filter { comment -> comment.postId == postData.id }
PostDetail(
postData.id,
postData.body,
comments.map { PostComment(it.id, it.name, it.email, it.body) }
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment