Set addToCart post event behavior programmatically

When using the CartIcon “addtoCart” method, we can’t change its default behavior to display the Mini Cart. It would be cool if we could set this behavior, just like we already can when using the standard ProductPage from Wix: