resaca icon indicating copy to clipboard operation
resaca copied to clipboard

hiltViewModelScoped returns new viewModel with old bundle argument on key change

Open LightningGem opened this issue 2 years ago • 8 comments

i have following VM:

val viewModel: TorrentDetailsViewModel = hiltViewModelScoped(
        key = hash, defaultArguments = bundleOf(TorrentDetailsViewModel.HASH_KEY to hash)
    )

After composable is recomposed with new hash, new viewModel is returned, but bundle hash value is old. Image pic2

LightningGem avatar Jul 07 '23 23:07 LightningGem