---
title: "Comment by Nathan Meade on \"Retrofit with MVVM in Jetpack Compose\" | Hashnode"
description: "Why not wrap the getPosts function return type with a Retrofit Response to check for a successful response from ApiService?"
url: "https://hashnode.com/posts/retrofit-with-mvvm-in-jetpack-compose/63dceb874b9f4e3be47a0a72/comment/642af853351232fa62945479"
---

[Discussion](https://hashnode.com/posts/retrofit-with-mvvm-in-jetpack-compose/63dceb874b9f4e3be47a0a72)

Comment [Retrofit with MVVM in Jetpack Compose](https://hashnode.com/posts/retrofit-with-mvvm-in-jetpack-compose/63dceb874b9f4e3be47a0a72)

[Nathan Meade](https://hashnode.com/@nathanmeade)

[Apr 3, 2023](https://hashnode.com/posts/retrofit-with-mvvm-in-jetpack-compose/63dceb874b9f4e3be47a0a72/comment/642af853351232fa62945479)

Why not wrap the getPosts function return type with a Retrofit Response to check for a successful response from ApiService?

[saurabh jadhav](https://hashnode.com/@saurabhjadhav)

[May 17, 2023](https://hashnode.com/posts/retrofit-with-mvvm-in-jetpack-compose/63dceb874b9f4e3be47a0a72/comment/642af853351232fa62945479#reply-6464ac18bb615ac11d996485)

Thank you for your suggestion! In this specific case, the response handling is already implemented within the getPost() function of the MainViewModel. The Flow<List<Post>> returned by mainRepository.getPost() allows us to handle success and error scenarios using the collect operator. Therefore, explicitly wrapping the return type with Response<List<Post>> may not be necessary in this context. Nonetheless, I appreciate your input and consideration.
