Open Shenglian opened 5 years ago
In order to solve flickering Spinner function waitAtLeast(time: number, promise: any) { const promiseTimeout = new Promise(resolve => setTimeout(resolve, time)) const promiseCombined = Promise.all([promise, promiseTimeout])
In order to solve flickering Spinner
function waitAtLeast(time: number, promise: any) { const promiseTimeout = new Promise(resolve => setTimeout(resolve, time)) const promiseCombined = Promise.all([promise, promiseTimeout])
return promiseCombined.then(values => values[0]) }
Article
Demo
return promiseCombined.then(values => values[0]) }