Skip to content

Instantly share code, notes, and snippets.

@elihart
Created November 20, 2019 17:32
Show Gist options
  • Save elihart/9ee354c57e60f2a37b448623cc19b4fa to your computer and use it in GitHub Desktop.
Save elihart/9ee354c57e60f2a37b448623cc19b4fa to your computer and use it in GitHub Desktop.
MvRx Nested Set Syntax Example
state("Empty results") {
// Nested copying - gross!
copy(request = Success(request.copy(results = emptyList())))
// A cleaner way to specify the same thing
set {  ::request { success {  ::results } } }.with { emptyList() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment