Check out example codes for "how to await a task c#". It will help you in understanding the concepts better.
Code Example 1
private async void myEvent()
{
Task myTask = MyFunction(); // MyFunction should return a task!
var result = await myTask;
}
private void SomeFunction()
{
// some code
// .....;
//
myEvent?.Invoke(); // Invoke myEvent -> myEvent is async
Task.WaitAny(myTask);
if(myTask.isCompleted)
DoSomething();
}
Learn ReactJs, React Native from akashmittal.com