Created
          June 17, 2018 18:56 
        
      - 
      
 - 
        
Save v170nix/f17e6a9597623a61cf7a82e2e4e94c49 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or 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
    
  
  
    
  | inline fun <reified T : ViewModel> FragmentActivity.injectViewModel(factory: ViewModelProvider.Factory): T { | |
| return ViewModelProviders.of(this, factory)[T::class.java] | |
| } | |
| inline fun <reified T : ViewModel> Fragment.injectViewModel(factory: ViewModelProvider.Factory): T { | |
| return ViewModelProviders.of(this, factory)[T::class.java] | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment