Skip to content

Instantly share code, notes, and snippets.

@kishansinhparmar
Created July 19, 2019 05:17
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 kishansinhparmar/3232dd52492cfa65110c7659e7c1e016 to your computer and use it in GitHub Desktop.
Save kishansinhparmar/3232dd52492cfa65110c7659e7c1e016 to your computer and use it in GitHub Desktop.
View model with repository
class $viewModelName$Factory(val repo: RepoModel) : ViewModelProvider.Factory {
override fun <T : ViewModel?> create(modelClass: Class<T>): T = $viewModelName$(repo) as T
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment