Skip to content

Instantly share code, notes, and snippets.

@naltynbekkz
Created April 25, 2020 18:30
Show Gist options
  • Save naltynbekkz/583010475e5d5d902e011735665f7ae0 to your computer and use it in GitHub Desktop.
Save naltynbekkz/583010475e5d5d902e011735665f7ae0 to your computer and use it in GitHub Desktop.
class BlogViewModel @AssistedInject constructor(
@Assisted private val savedStateHandle: SavedStateHandle,
blogsRepository: BlogsRepository
) : ViewModel() {
@AssistedInject.Factory
interface Factory : ViewModelAssistedFactory<BlogViewModel>
val blog = blogsRepository.getBlog(savedStateHandle.get("blog_id")!!)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment