How to use hide and show indicator during ajax requests in V2

Like this?

onAjaxStart: function (xhr) {
app.preloader.show();
},
onAjaxComplete: function (xhr) {
app.preloader.hide();
}