Javascript Wait For Async Function In Useeffect