Custom Events and EventTarget: Decoupled Communication in WordPress Plug ...
CustomEvent and EventTarget: let the parts of a WordPress script talk The mini cart in the header should update when a product is added on the page, the counter in the sidebar too, and an analytics script wants to know about it as well. If the add-to-cart code calls all three directly, it has to…