I am writing a Shopify app and I would want to listen to the shopify cart update event. I know that when user clicks on remove or increase the item quantity. Shopify send a POST request to the backend to update the card. My app calculates the shipping value based on shopify cart item quantity. I add my app script to the shopify via script-tag.
I tried to listen to the quantity input but this event only fires one. I think shopify updates the input DOM after every cart update so it may remove my listener.
$('body').on('change', '.input[name="updates[]"]', function() { console.log('HELLO')});
How can I listen to the cart update event? It seems to be a simple question but I really cannot find any answer regarding to Shopify!