Check out example codes for "kotlin coroutine invoke completion". It will help you in understanding the concepts better.

Code Example 1

fun getData(){
	uiScope.launch{
    	dataRepository.getData()
    }.invokeOnCompletion{
    	Log.d("Tag","Called after completion")
    }
}

Learn ReactJs, React Native from akashmittal.com