Skip to content

Instantly share code, notes, and snippets.

@pcote
Created October 6, 2016 22:44
Show Gist options
  • Save pcote/eab8655d5ec5ead821f1c43d629b26ce to your computer and use it in GitHub Desktop.
Save pcote/eab8655d5ec5ead821f1c43d629b26ce to your computer and use it in GitHub Desktop.
var revertDom = function(num){
var __callback = function(creds){
var uname = creds.username;
var pw = creds.password;
var authString = "Basic " + btoa(uname + ":" + pw);
var req = {
url: "/revert/" + num,
method: "get",
headers: {
"Authorization": authString
}
};
var promise = $.ajax(req);
return promise;
};
return __callback;
};
var credsPromise = getCreds();
var revertDomCB = revertDom(num);
var revertDomPromise = credsPromise.then(revertDomCB);
revertDomPromise.then(updateDomFields);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment