-
Notifications
You must be signed in to change notification settings - Fork 149
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
fix: Use recomposed map listener callbacks rather than only the initially … #478
Conversation
8348662
to
d31d25d
Compare
d31d25d
to
2115e48
Compare
8795698
to
e09d848
Compare
@kikoso would you have time for a review? Happy to explain changes. Would like to get it merged soon to not let the issue fester longer. Have a few other PRs waiting on this one. |
Hi @bubenheimer ! Thanks for putting this PR together. Since there are a few that could depend on the output of this one, let's focus on getting this one merged first. The internal behavior of Google Maps follows this approach (using a POI and
As a rule of thumb, the map invokes any user-provided listeners first, and then afterwards processes internally the event to perform any other actions. From your approach: the fact that it is not a breaking change, and that the logic of the The PR seems to honor that A) Recomposed callbacks are working, and B) They default to the Google Map listener if they are null. The PR looks good. Let me check if there are no further issues and get back!. |
Hi @bubenheimer, This looks good to be merged, will do it soon. |
…ally composed version Fixes googlemaps#466
…tes to after parent composition, not during parent composition
9215d1b
to
001a8ea
Compare
Bump |
…ate updates to after parent composition, not during parent composition" This reverts commit dff2b0a.
I've reverted the earlier commit that moved the initial parts of updating the listener callbacks into a SideEffect. The SideEffect approach delays the listener updates to a future recomposition cycle, which I have to come to consider too slow. Without SideEffect there is the issue of spurious recompositions that I believe are fast and do essentially nothing. However, the listeners are updated more quickly. I have not seen issues in terms of affected code behaving incorrectly because of the spurious recompositions. The spurious recompositions are not specific to this PR, they are prone to happen with the current GoogleMap() subcomposition approach in general: #480 |
🎉 This PR is included in version 4.3.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
…composed version
Fixes #466
This solution is optimized for the common case of recomposition updating a non-null GoogleMap listener callback to another non-null callback, and has negligible overhead, supporting rapid recomposition.
The other, less common case, toggling between null and non-null callbacks, calls the appropriate GoogleMap SDK listener setter in the composition apply phase; any overhead from calling the setter is passed through.
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly: