Add to favourites functionality using MVVM Best Practice
I am working with MVVM architecture and trying to use best practices in documentation.
Let me explain what I have done and what is my problem.
I have a fragment and a parent fragment. When user enters a string to searchview which is in parent fragment, I collect the data and fetch the list to recyclerview.
I have a list adapter which takes care of favourite button for each elements in recyclerview. And I implemented a callback to listadapter:
val onFavouriteChanged: (id, isFavourited) ->...