Created
November 20, 2019 17:32
-
-
Save elihart/9ee354c57e60f2a37b448623cc19b4fa to your computer and use it in GitHub Desktop.
MvRx Nested Set Syntax Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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