Skip to content

Instantly share code, notes, and snippets.

@oradkovsky
Created April 28, 2020 18:59

Revisions

  1. oradkovsky created this gist Apr 28, 2020.
    7 changes: 7 additions & 0 deletions Koin: Shared ViewModel
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    class MyFragment1 : Fragment() {
    private val myViewModel: MyViewModel by sharedViewModel()
    }

    class MyFragment2 : Fragment() {
    private val myViewModel: MyViewModel by sharedViewModel()
    }