jsworkerutils
Version:
Helper class that improves the the loading processes, an implementation of multithreaded JS # Development Guide ## About - This library is meant to be a node packaged module that optimize concurrent api requests and simplify as much as possible , the li
20 lines • 597 B
JavaScript
;
/**
* @file defines an event listener for webworker spawning a different process
* this only calls the fetch library to load from a url passed to the worker
* and returns the response
* the file is being loaded by an helper file `file-loader.d.ts`
*/
addEventListener('message', function (e) {
fetch(e.data).then(function (data) {
try {
data.json().then(function (retData) {
postMessage(retData);
});
}
catch (err) {
postMessage(err);
}
});
});
//# sourceMappingURL=apiwebworkers.js.map