k-l-lambda's picture
updated node_modules
4cadbaf
raw
history blame contribute delete
331 Bytes
export default function sendRequest (conf) {
fetch(conf.url, conf.data).then(res => res.text()).then(data => {
//console.log("data:", data);
if (conf.onload)
conf.onload({ responseText: data });
}).catch(e => {
console.warn("DOMLoader.sendRequest error:", e);
if (conf.onerror)
conf.onerror(e, false);
});
};