aboutsummaryrefslogtreecommitdiff
path: root/compat/lustre_http/src/ffi.mjs
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2023-09-19 23:40:03 +0100
committerHayleigh Thompson <me@hayleigh.dev>2023-09-19 23:40:03 +0100
commit92e8596b78982885803994b50c6b35f73f7a403e (patch)
tree13428243987317da540495215ed4d9e3938fb5cb /compat/lustre_http/src/ffi.mjs
parent985a9b0aa469cbe94fb95c433c97e2b321014341 (diff)
downloadlustre-92e8596b78982885803994b50c6b35f73f7a403e.tar.gz
lustre-92e8596b78982885803994b50c6b35f73f7a403e.zip
:recycle: So long monorepo.
Diffstat (limited to 'compat/lustre_http/src/ffi.mjs')
-rw-r--r--compat/lustre_http/src/ffi.mjs16
1 files changed, 0 insertions, 16 deletions
diff --git a/compat/lustre_http/src/ffi.mjs b/compat/lustre_http/src/ffi.mjs
deleted file mode 100644
index bb01b09..0000000
--- a/compat/lustre_http/src/ffi.mjs
+++ /dev/null
@@ -1,16 +0,0 @@
-export const do_request = (method, url, body, on_success, on_error) => {
- let xhr = new XMLHttpRequest()
- xhr.onerror = _evt => {
- console.log("error for", method, url, ":", xhr)
- on_error(888, "oops!")
- }
- xhr.onloadend = _evt => {
- switch (xhr.status) {
- case 200:
- case 204: on_success(xhr.responseText); break;
- default: on_error(xhr.status, xhr.responseText)
- }
- }
- xhr.open(method, url)
- xhr.send(body);
-}