Skip to content

Instantly share code, notes, and snippets.

View alex-exerve's full-sized avatar

Alex Riviere alex-exerve

  • Norcross, GA
View GitHub Profile
@brizandrew
brizandrew / ajaxPromise.js
Created July 11, 2017 20:25
Wraps jQuery's ajax implementation inside an ES6 Promise structure.
// This code snippet requires jQuery to be loaded onto the page.
/**
* Wraps jQuery's ajax implementation inside an ES6 Promise structure.
* Source: https://stackoverflow.com/questions/35135110/jquery-ajax-with-es6-promises
* @function ajax
* @param {object} options - The config to pass to the ajax call.
* @return {object} - A Promise object to complete an ajax call.
*/
function ajax(options) {