Created
March 19, 2019 11:31
-
-
Save Nimrodda/8f4dfa4af874b63be7c41de417549975 to your computer and use it in GitHub Desktop.
This file contains 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
class DetailViewModel @AssistedInject constructor( | |
private val githubApi: GithubApi, | |
@Assisted private val handle: SavedStateHandle | |
) : ViewModel() { | |
fun loadData() { | |
val id = handle["id"] ?: "default" | |
viewModelScope.launch { | |
val response = githubApi.getCommit(id) | |
// Handle response | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment