const AjaxLoaderMixin = {
    data: function () {
        return {
            loading_: false,
        }
    },
    methods: {
        loadDataFromServer_: function (data = {}, ajaxData = {}) {
            return new Promise(function (resolve, reject) {
                this.loading_ = true;
                this.$request().post({
                    ...data,
                    ...{
                        cid: this.cid,
                        namespace: this.namespace,
                        ajaxData: ajaxData,
                    },
                }).then(function (data) {
                        this.loading_ = false;
                        this.$responseValidator().validate(data.data);
                        this.$actionHandler().handle(data.data.actions ? data.data.actions : []);
                        this.processSlotsFromResponse_(data.data);
                        resolve(data);
                    }.bind(this)
                ).catch(function (e) {
                        reject(e);
                    }.bind(this)
                ).finally(function () {
                    this.loading_ = false;
                }.bind(this));
            }.bind(this));
        }
    }
}