Dispatch events with both CustomEvent and jQuery#3185
Conversation
Events are now dispatched using both the native CustomEvent API and jQuery's trigger for backward compatibility. This ensures that all listeners, regardless of implementation, receive the events.
|
Hello, maybe add a subscription system or something ? to not overflood listeners ? |
|
Hello, Dispatching both natively and via jQuery for the same event risks more than just duplicate execution, the two firings wouldn't even behave consistently. jQuery's Given it'll probably take a long time before every plugin has migrated its listeners to vanilla JS, an opt-in path seems safer than a blanket switch: keep an extensible |
Description
Problem
Currently, only core Jeedom events (hardcoded list) can use [dispatchEvent] (native CustomEvent). Plugins are forced to use jQuery only.
Solution
Removed the restricted event list. All events (core and plugins) now use :
Events are now dispatched using both the native CustomEvent API and jQuery's trigger for backward compatibility. This ensures that all listeners, regardless of implementation, receive the events.
Suggested changelog entry
Support natif des CustomEvent pour les plugins
Related issues/external references
Fixes #
Types of changes
PR checklist