1

I have this particular test case that I don't know how to solve with Koin.

I have a FooClass tied to the MainActivity lifecycle, and I have other fragments that also need to use FooClass. Those fragments need the FooClass to be inject in the viewmodels. (I don't want to declare FooClass as single)

I tried

    scope<MainActivity>{
        scoped { FooClass() }
        viewModel { FragmentSimpleViewModel(get()) }
    }

How can I do this?

appersiano
  • 2,670
  • 22
  • 42

0 Answers0