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

Filter restartable effects explicitly #84

Merged
merged 2 commits into from
Sep 26, 2022
Merged

Conversation

mrmans0n
Copy link
Contributor

In ComposeViewModelForwarding we were blank checking that *Effect was not used. In reality, the list of restartable effects is smaller and we could keep it up to date ourselves.

// From https://developer.android.com/jetpack/compose/side-effects#restarting-effects
private val RestartableEffects by lazy(LazyThreadSafetyMode.NONE) {
setOf(
"LaunchedEffect",
Copy link
Contributor

Choose a reason for hiding this comment

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

would this ever need to be externally configurable like the emissions Composable list?

Copy link
Contributor Author

@mrmans0n mrmans0n Sep 26, 2022

Choose a reason for hiding this comment

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

Not the list of restartable effects per se, but it would be nice to add them as an extra list of things allowed in ViewModelForwarding (eg you have a composable that uses the VM for keying). Can't think of an use case on the top of my head but I'm sure it could be useful to support. And given that the cost of adding it to the config is minimal, I'll do that 😆

Will do this in a separate patch though.

@mrmans0n mrmans0n merged commit 051a55e into main Sep 26, 2022
@mrmans0n mrmans0n deleted the nacho/restartable-effects branch September 26, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants