A
A
Alex Smith2017-08-25 18:37:03
JavaScript
Alex Smith, 2017-08-25 18:37:03

How to make asynchronous ajax in Vuex?

There is a method in which ajax, the question is how to make it asynchronous?

this.$http.get(url).then(function(response){
                        thiss.trackdata = response.body;
                        thiss.trackSaveStatus(o.track, response.body);
                        thiss._loading(false);
                        if(callback){
                            callback();
                        }
                    }, function(response){
                        thiss._loading(false);
                   

                    });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Shashenkov, 2017-08-25
@teknik2008

I'm ready now. Asynchronous.
.then- Promise result. A $http.get- returns a promise that will be executed asynchronously

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question