Event listener for ExtractArchive
My understanding is that Things[fileRepositoryThing].ExtractArchive(params) is an asynchronous function. Is there an event listener service similar to addEventListener( ) that I can use to run a callback function when the extraction is complete?
I am moving the file after it's extracted, but I want to make the process more efficient by using some kind of event listener instead of a do while loop.
let moveFileComplete = false;
do {
try {
Things["SystemRepository"].MoveFile({
targetPath: "/Push/" + me.name + "/" + fileName /* STRING */ ,
overwrite: true /* BOOLEAN */ ,
sourcePath: "/temp/Push/" + fileName /* STRING */
});
moveFileComplete = true;
} catch (err) {
moveFileComplete = false;
pause(29999); //pause to ensure file extraction is complete before restarting loop
}
} while (!moveFileComplete);
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

