Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on Mobius Controller #158

Open
rajdheepak opened this issue Nov 16, 2022 · 2 comments
Open

Clarification on Mobius Controller #158

rajdheepak opened this issue Nov 16, 2022 · 2 comments

Comments

@rajdheepak
Copy link

    @pettermahlen We are mostly using mobius loops with viewmodel across our app. 

What is the use case for a mobius controller?

Can Mobius Controller be thought of an equivalent to VM with loop?

Could you give me actual example use cases for Using Mobius controller over VM with loop?

Originally posted by @rajdheepak in #157 (comment)

@togi
Copy link
Collaborator

togi commented Nov 16, 2022

The controller it's just an utility to be able to interrupt and continue a loop from its last state, plus it helps set up the cyclic dependency between UI and business logic. The controller predates MobiusLoopViewModel, and if you use MLVM then there is no need to have a controller.

@rajdheepak
Copy link
Author

Any thoughts/suggestions on how does Mobius architecture glue into the android paging library? I am guessing you must have a lot of paging stuff in spotify, some insights please.

What are we doing now? TLDR- VM holding the loop is supplied to the data source which uses VM instance to dispatch events and observe states which eventually updates data on callbacks in loadBefore/loadAfter.

@togi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants