/** * This file is part of Haketilo. * * Function: Wrapping XMLHttpRequest into a Promise. * * Copyright (C) 2021 Wojtek Kosior * Redistribution terms are gathered in the `copyright' file. */ function ajax_callback() { if (this.readyState == 4) this.resolve_callback(this); } function initiate_ajax_request(resolve, reject, method, url) { const xhttp = new XMLHttpRequest(); xhttp.resolve_callback = resolve; xhttp.onreadystatechange = ajax_callback; xhttp.open(method, url, true); try { xhttp.send(); } catch(e) { console.log(e); setTimeout(reject, 0); } } function make_ajax_request(method, url) { return new Promise((resolve, reject) => initiate_ajax_request(resolve, reject, method, url)); } /* * EXPORTS_START * EXPORT make_ajax_request * EXPORTS_END */ tion> Wojtek's customized Guix
aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests/singularity.scm
AgeCommit message (Expand)Author
2019-11-09tests: Update references to the now-deprecated 'guile-json' variable....Ludovic Courtès
2019-07-04pack: 'squashfs' backend records the profile's search paths....Ludovic Courtès
2019-06-07pack: Add '--entry-point'....Ludovic Courtès
2019-06-07services: Add Singularity....Ludovic Courtès