Is there a best practice for triggering events and...
# suitecommerce
m
Is there a best practice for triggering events and catching them across different extensions? I have been doing this so far against the cart component, but wondering if there is a better way? This is essentially how I have been doing it. Trigger in one extension:
Copy code
var cartComponent = container.getComponent("Cart");
cartComponent.cancelableTrigger("after:module.action", data);
Catch in another extension:
Copy code
var cartComponent = container.getComponent("Cart");
cartComponent.cancelableOn("after:module.action", function(data) {
    handle(data);
});