Simplify view model and view model state abstraction
wax911 opened this issue · 0 comments
wax911 commented
AniTrend Issue Guidelines
Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.
You may find an answer in already closed issues:
https://github.com/AniTrend/anitrend-v2/issues?q=is%3Aissue+is%3Aclosed
Feature Information
Our current implementation of ViewModel
and ViewModelState
has a lot of duplication which can be better abstract away behind the existing abstractions.
Solution Information
- Move the all the implementations of
ISupportViewModelState
and theuseCaseResult
mutable live data objects and abstract them away intoAniTrendViewModelState
- Remove hooks and
onClear
events forAniTrendViewModelState
into a new abstraction that will be calledAniTrendViewModel
that replaces all qualified references ofViewModel
, this will have one argument constructor argument calledstate
of the abstract type ofAniTrendViewModelState<*>
. - Refactor
[app-core]
view model extensions forhook
to only expect one argument as part of a Single responsibility revamp to enforce one state per view model
Additional Context
N/A