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

refactor: merge AgendaLayoutViewModel with AgendaPagerViewModel and access it only from the top-level AgendaLayout #340

Merged
merged 2 commits into from
Mar 1, 2025

Conversation

cbeyls
Copy link
Collaborator

@cbeyls cbeyls commented Mar 1, 2025

This allows loading and caching all the Agenda data (rooms, sessions, speakers) in a single StateFlow in a single ViewModel instead of loading the rooms twice.

  • It follows the best practice of making reusable Composable functions more modular by decoupling them from the ViewModel. AgendaViewModel is now only retrieved and observed from a single place: the top-level AgendaLayout, and callbacks are used in all lower-level composables.
  • Deleted the obsolete AgendaLayoutViewModelTest as it brings no real value. More useful tests should be written in the future.

@cbeyls cbeyls self-assigned this Mar 1, 2025
@cbeyls cbeyls merged commit 48b7e34 into main Mar 1, 2025
1 check passed
@cbeyls cbeyls deleted the refactor/agendaviewmodel branch March 1, 2025 18:15
martinbonnin pushed a commit that referenced this pull request Mar 7, 2025
…ccess it only from the top-level AgendaLayout (#340)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant