Last active
January 29, 2018 23:25
-
-
Save puzzfuzz/a6af55e69ec733dfbbd90201d9494bdb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rigging.js | |
class Rigging { | |
/* ... */ | |
cartUpdated = (newCart) => { | |
this.dispatch(cartActions.cartUpdated(newCart)); | |
}; | |
} | |
// templates/product.liquid | |
$('#AddToCartBtn').on('click', function() { | |
ShopifyAPI.addItemToCart({{ product.handle }}) | |
.then(function(newCart) { | |
// Call Rigging directly from a window-level event to dispatch data | |
// into the Redux store | |
window.Rigging.cartUpdated(newCart); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment