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 ReadingListFragment to use ViewModel. #5214

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

terofeev
Copy link
Contributor

@terofeev terofeev commented Jan 9, 2025

What does this do?

  • Refactored ReadingListFragment to use ViewModel.
  • Added ReadingListFragmentViewModel and moved the update list logic into it.

Why is this needed?

Tech-debt.
Reduce complexity by simplifying the UI layer.

Phabricator:
https://phabricator.wikimedia.org/T303935

}
}

class ReadingListWrapper(val readingList: ReadingList?)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added wrapper class because the data has non-nullable type T.

open class Resource<T> {
    ...
    class Success<T>(val data: T) : Resource<T>()
    ...
}

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

Successfully merging this pull request may close these issues.

2 participants