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

Question - collectAsStateWithLifecycle #711

Open
JuxBzh opened this issue Feb 28, 2024 · 4 comments
Open

Question - collectAsStateWithLifecycle #711

JuxBzh opened this issue Feb 28, 2024 · 4 comments

Comments

@JuxBzh
Copy link
Contributor

JuxBzh commented Feb 28, 2024

This article from Manuel Vivo suggests to use collectAsStateWithLifecycle API instead of standard collectAsState to safely consume flows in Jetpack Compose.
I noticed that extension provided in mvrx-compose module rely on collectAsState. Is it planned to use to collectAsStateWithLifecyle or is there a specific feature in Mavericks implementation that makes it already Lifecycle aware ?

Regards.

@elihart
Copy link
Contributor

elihart commented Mar 1, 2024

I don't think modifying the existing collectAsState functions would be good, as it might not be what some people want, but we could add equivalent methods for collectAsStateWithLifecyle in https://github.com/airbnb/mavericks/blob/main/mvrx-compose/src/main/kotlin/com/airbnb/mvrx/compose/MavericksComposeExtensions.kt

Feel free to put up a PR

@JuxBzh
Copy link
Contributor Author

JuxBzh commented Mar 29, 2024

Hi @elihart.
I'm trying to put up a PR but I constantly get rejected when trying to push my branch event if I created the proper Personal Access Token. Is there something more I need to do ?

@elihart
Copy link
Contributor

elihart commented Apr 1, 2024

The way github works, you need to fork the project and push the branch to your fork, then create a PR from there

@JuxBzh
Copy link
Contributor Author

JuxBzh commented Apr 3, 2024

Thanks for the advice. Here is the PR -> #714

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

No branches or pull requests

2 participants