Skip to content

refactor: unify source handling #354

@d-koppenhagen

Description

@d-koppenhagen

Is your feature request related to a problem? Please describe.
Currently each Source component has some common code which will create the corresponding OpenLayers source, watch for any changes, applies / removes the source. The code therefore is mostly duplicated in each component but sometimes a bit different.

Describe the solution you'd like
To simplify component setup (as well for possible plugin providers), the base code should be extracted in a separate composable.
Also the usage of computed / shallowRef for the created sources should be unified.
A shallowRef should be good enough and it prevents the re-creation of the source instance on side effects which could lead into performance issues or issues with not cleaned up sold sources.

Describe alternatives you've considered
none.

Additional context
This will possibly introduce a breaking change.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions