Combination of async function + await + setTimeout

前端 未结 12 1350
予麋鹿
予麋鹿 2020-11-22 04:34

I am trying to use the new async features and I hope solving my problem will help others in the future. This is my code which is working:

  async function as         


        
12条回答
  •  灰色年华
    2020-11-22 05:29

    This is a quicker fix in one-liner.

    Hope this will help.

    // WAIT FOR 200 MILISECONDS TO GET DATA //
    await setTimeout(()=>{}, 200);
    

提交回复
热议问题