結果 : typescript wait until function is finished