In recent Android Architecture Components library released by Google, we have two static functions in the Transformations class. While the map function
Transformations
map
The function passed to switchMap returns LiveData. Use it when your repository itself returns LiveData.