This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var embedJquery = function (callback) { | |
var js = document.createElement('script'); | |
js.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'; | |
js.onload = function () { | |
jQuery.noConflict(); | |
callback(jQuery); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// awaitable(fn, [arg1, [arg2[, ..., argN]]]) | |
// Always returns array of results. | |
const awaitableSpread = (fn, ...args) => { | |
if (typeof fn !== 'function') | |
throw new Error(`awaitable() needs a function as first argument, got "${typeof func}"`); | |
return new Promise((resolve, reject) => { | |
fn.call(null, ...args, (err, ...results) => { |