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

Remove public currentCameraPositionState property #500

Open
bubenheimer opened this issue Jan 5, 2024 · 2 comments
Open

Remove public currentCameraPositionState property #500

bubenheimer opened this issue Jan 5, 2024 · 2 comments
Labels
triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@bubenheimer
Copy link
Contributor

Compose 4.3.0

#262 introduced a public currentCameraPositionState property. I don't think this was a good idea from an architectural standpoint, as this allows & suggests configuring the map from inside the map subcomposition by user code. Map configuration is generally intended to be done at the top level via parameters of the GoogleMap() composable. CameraPositionState is one of the parameters passed to GoogleMap(), duplicating responsibilities for CameraPositionState configuration.

If user code does need access to CameraPositionState from inside the subcomposition it can pass it down itself in whatever form it deems most appropriate: read-only position, read/write state, or some other kind of wrapper; captured lambda variable, parameter, or CompositionLocal. These decisions need to be left to user code.

@bubenheimer bubenheimer added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jan 5, 2024
@bubenheimer bubenheimer changed the title Remove public currentCameraPositionState to prevent map configuration changes from inside subcomposition Remove public currentCameraPositionState Jan 5, 2024
@bubenheimer bubenheimer changed the title Remove public currentCameraPositionState Remove public currentCameraPositionState property Jan 5, 2024
@bubenheimer
Copy link
Contributor Author

This concern could be addressed by making the property non-public or whatever "internal" library consumers actually need.

@bubenheimer
Copy link
Contributor Author

bubenheimer commented Jan 5, 2024

Also, this property, in its present form, prevents performing initial composition of the GoogleMap() subcomposition in parallel with GoogleMap object initialization: #501

Edit: I don't think this is the case, actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

1 participant