Integration for molecule along with Android Architecure Components ViewModel

This is a library that was inspired from this discussion in the molecule repo about how to properly use molecule with Android's ViewModel.
The code was something we have been using over at the Hedvig App for quite some time which has worked well for us
The core concept is that you use Molecule for your presenter, with one extra step, a lastState parameter coming in to your presenter's present function.
That lastState will initially be the initialState that was passed to the MoleculeViewModel.
But importantly, if the a ViewModel which is still alive in-memory (for example was an entry in the backstack that you've come back to) starts having a new consumer again, since SharingStarted.WhileSubscribed(5.seconds) is used by default, the moleculeFlow will start emitting new values again, but this time the will be exactly what the last emission was.
This helps with scenarios where you come back into a view which was on the backstack, to immediatelly have the last state available to you, as opposed to starting from a Loading state and having to fetch everything from scratch, which often results in a more poor user experience.
Sample usage for a feature named "Dogs":
State, Event and Data
ViewModel
internal class DogsViewModel(
dogsRepository: DogsRepository,
) : MoleculeViewModel<DogsEvent, DogsUiState>(
initialState = DogsUiState.Loading,
presenter = DogsPresenter(dogsRepository),
)
Presenter
More real life usages can be found here