結果 : react wait until function is done