Skip to content

Instantly share code, notes, and snippets.

@lewisevans
Last active November 15, 2018 16:41
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 lewisevans/e606a4ec633c982f4f266b7a5ad578da to your computer and use it in GitHub Desktop.
Save lewisevans/e606a4ec633c982f4f266b7a5ad578da to your computer and use it in GitHub Desktop.
class MyFragment : BaseFragment<MyViewModel>() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
viewModel = viewModelWith(activity!!)
with(viewModel) {
/*DO SOME STUFF HERE*/
}
}
}
@lewisevans
Copy link
Author

lewisevans commented Nov 15, 2018

The ViewModel can have anything injected into the constructor class MyViewModel @Inject constructor(private val getRoutesUseCase: MyUseCase) : BaseViewModel()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment