Function for show overlay for long-running operations. The loader will be displayed until the action is completed.
tisa.utils.runWithLoader(async () => { console.log("Main operation started..."); // simulation of asynchronous operation await new Promise(resolve => setTimeout(resolve, 2000)); await tisa.utils.runWithLoader(async () => { console.log("Sub-operation started..."); // simulation of asynchronous operation await new Promise(resolve => setTimeout(resolve, 3000)); console.log("Sub-operation completed."); }, "Processing sub-task..."); // simulation of asynchronous operation await new Promise(resolve => setTimeout(resolve, 2000)); console.log("Main operation completed.");}, "Processing main task..."); Copy
tisa.utils.runWithLoader(async () => { console.log("Main operation started..."); // simulation of asynchronous operation await new Promise(resolve => setTimeout(resolve, 2000)); await tisa.utils.runWithLoader(async () => { console.log("Sub-operation started..."); // simulation of asynchronous operation await new Promise(resolve => setTimeout(resolve, 3000)); console.log("Sub-operation completed."); }, "Processing sub-task..."); // simulation of asynchronous operation await new Promise(resolve => setTimeout(resolve, 2000)); console.log("Main operation completed.");}, "Processing main task...");
Function for show overlay for long-running operations. The loader will be displayed until the action is completed.
Example