I have a React/ Flux app I am trying to return my "promiseSuccessData" but it has to be done outside of the ajax promise. Within the getChallengeData().
getChallengeData : function() {
$.ajax({
type: 'GET',
url: baseUrl + '1.0/challenge/result/' + challengeId,
crossDomain: true,
xhrFields : {
withCredentials : true
},
})
.done(function(promiseSuccessData) {
_challenges = promiseSuccessData;
})
.fail(function(jqXhr) {
console.log(jqXhr)
console.log('failed to register');
});
//This is where I want to "return _challenges" but _challenges isn't available here
},