Pins: Consider external updates and allow ignoring change sources#768
Pins: Consider external updates and allow ignoring change sources#768oeninghe-dataport wants to merge 7 commits into
Conversation
As we use the vite plugin enriched console, we do not specify the source of a log message manually.
This ignores changes originated from addressSearch to the pins coordinate for the reverseGeocoder in the snowbox. Fixes #655
|
The target should probably be |
Fixed.
|
| ) | ||
| return | ||
| } | ||
|
|
||
| watcherConfig.handle = watch( | ||
| () => store[watcherConfig.source.key], | ||
| watcherConfig.callback, | ||
| (value) => { | ||
| const sourceKey = watcherConfig.source.key + 'Source' |
There was a problem hiding this comment.
This lacks documentation. Please add information e.g. to the TSDoc of the composable that, if I watch the parameter coordinate I will ignore updates if I have a parameter coordinateSource in my store and have ignoredSources configured.
As this requires a lot of knowledge and extra implementation for each plugin with a possible reference loop, isn't there a possibility of a different approach without the need of further boilerplate in any plugins?
There was a problem hiding this comment.
For the documentation: dfb50f2
On your question:
I'm also not too happy with the current solution. However, the following aspects convinced me to go with this:
- The pins plugin seems to be the natural participant in reference loops, even in the future. It allows reading and writing of other plugins in a useful way, which is the case for few plugins; usually, our plugins communicate in one direction only. I don't expect that we will need this in another plugin in the future.
- I found no approach without further boilerplate (that is not much more "hack-y" than this one). At least this approach allows re-using it in every plugin that refers to pins.
|

Summary
Consider external updates (#766) and allow ignoring change sources (#655).
Instructions for local reproduction and review
See #766 and #655
Relevant tickets, issues, et cetera
Fixes #766
Fixes #655