Skip to content

Instantly share code, notes, and snippets.

@lookashc
Last active December 21, 2020 11:08
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 lookashc/cc14ca0f0d777609ae0af4cb39a2aa32 to your computer and use it in GitHub Desktop.
Save lookashc/cc14ca0f0d777609ae0af4cb39a2aa32 to your computer and use it in GitHub Desktop.
medium-feature-toggles-gist5
class AveragesCardViewModel(
private val showAveragesCardFeatureToggle: ShowAveragesCardFeatureToggle
) {
val isVisible: Boolean = showAveragesCardFeatureToggle.value
class Factory @Inject constructor(
private val showAveragesCardFeatureToggle: ShowAveragesCardFeatureToggle
) : ViewModelProvider.Factory() {
override fun <T : ViewModel> create(modelClass: Class<T>): T = 
AveragesCardViewModel(showAveragesCardFeatureToggle) as T
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment