Orhan Tozan

    Orhan Tozan

    2 years ago
    When using Koin/Dagger, is it usual to instantiate a repository on login and delete it on logout? Or maintain a single repository during the app's lifecycle, and clear it's cache when logging out?
    s

    Saurabh

    2 years ago
    If I get your question right, your first idea is to create a subcomponent for login flow and have something like a
    LoginRepository
    in scope only when this LoginComponent is active, right.
    I have implemented both of the ways you mentioned before (If my assumption above is correct). I like the subcomponent approach better.
    gildor

    gildor

    2 years ago
    Subcomponent approach is probably better solution, you may create dependencies with data available only for login user in constructor