I have a javascript file like this:
jQuery(document).ready(function($){
var mainWindown = top.document;
test = {
teesping_vesrion : '1.0.0',
mainStuff : function(){
var vars = {};
this.doStuff();
//refesh mini cart here
},
doStuff : function(){
......
}
)
})
i want to reload the minicart in my mainStuff function, but i dont know how to integrate the below code to my javascript file, which is to reload minicart:
<script>
require([
'Magento_Customer/js/customer-data'
], function (customerData) {
var sections = ['cart'];
customerData.invalidate(sections);
});
</script>