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
let all = Js.Promise.all; | |
let resolve = Js.Promise.resolve; | |
let reject = Js.Promise.reject; | |
let andThen = | |
(p: Js.Promise.t('a), fn: 'a => Js.Promise.t('b)): Js.Promise.t('b) => | |
p->Js.Promise.then_(fn, _); |
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
module Result = { | |
type result('a, 'b) = | |
| Ok('a) | |
| Error('b); | |
let isOk = (result_) => | |
switch result_ { | |
| Ok(_) => true | |
| Error(_) => false | |
}; | |
let isError = (result_) => |
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
if(!(window.jQuery)) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "https://code.jquery.com/jquery-2.2.1.min.js"); | |
script.setAttribute("type", "text/javascript"); | |
script.onload = logItems; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} else { | |
logItems(); | |
} |