I´m running several method calls that need to show the end user a loading modal and hide it when the method resturns a result. I was looking for a way to run this pre-call code and post-call code for every method without repeating code.
swal({
title: "Saving...",
onBeforeOpen: () => swal.showLoading()
});
Meteor.call("method", {/*params*/}, (err, res) => {
//Do something
swal.hide();
});
I want to be able to run those 2 swal codes without writing that code in each call. Is there some way to configure Meteor.call to do something before and after the call to the method?