...
Info |
---|
Example use-cases An end-user selects 2 IED's in 1 plug-in. In order to make a connection between IED's, the user want to open the selection in an another plug-in. Based on specific edits, a vendor specific plug-in can add vendor specific functionality (e.g. Siemens) XSD validation errors |
Also, since addons are not extending from a HTMLElement, addons cannot subscribe to events themselves. HTML events are only going upwards in the DOMTree, not downwards and/or to siblings.
...
It is possible to stop the event from bubbling further inside a plugin. This means that a plugin can negate an event that should be handled by a different plugin. (Plugin A sends an event (that should be read by Plugin B), Plugin C is listening to this event and stops the event from going further (event.preventDefault()). Because of Plugin C, plugin B never gets the event).
...
Alternative: Window object
Listen to the window .this.object. This object is used everywhere in the OpenSCD application.
Pro's:
Con's
- Risk of becomming a distributored monolith: Distributed Monoliths vs. Microservices: Which Are You Building? | Scout APM Blog
- OpenSCD cannot run in an iframe
Consequences
Implementing a central event-bus means that current OSCD plugins need some refactoring to dispatch events to the event-bus instead of dispatching events on itself.
...