https://kotlinlang.org logo
#android
Title
# android
b

bhatnagarm

03/08/2020, 1:20 PM
Hey guys, did anyone try writing Repository class with suspend function where the data is wrapped into NetworkBoundResource(showcased in architecture component sample GithubBrowser) and then exposed to ViewModel.
If yes let's discuss
s

Sr. Android Developer

03/08/2020, 6:15 PM
Yes
g

ghedeon

03/08/2020, 9:54 PM
b

bhatnagarm

03/09/2020, 4:07 AM
@ghedeon dude are you high on something?
@Sr. Android Developer could you share a snippet of your implementation.
d

dawidhyzy

03/09/2020, 7:22 AM
@bhatnagarm how is that related with Kotlin?
b

bhatnagarm

03/09/2020, 7:39 AM
@dawidhyzy I asked something related to coroutines. Isn't that related to kotlin?
Guys we are here for sharing our knowledge and try to learn from others, let's maintain the decorum. In case someone finds something wrong it's better to DM to the person in my opinion.
d

dawidhyzy

03/09/2020, 7:49 AM
I think you need be more specific with your question.
s

Siva Ganesh

03/09/2020, 1:46 PM
May be this might be of some help, have a look “Kotlin Coroutines, From the Basic to the Advanced” https://link.medium.com/sl4yg7BqI4
b

bhatnagarm

03/09/2020, 1:59 PM
@dawidhyzy I already mentioned the keyword "suspend" which itself brings the context. May be next time I'll specifically mention Kotlin
@Siva Ganesh thanks man for sharing. Let me go thru it
c

Christophe Smet

03/11/2020, 1:46 PM
Do people actually use NetworkBoundResource ?
b

bhatnagarm

03/11/2020, 1:55 PM
Well that's a good to have thing
Is there something new out there I'm unaware of
c

Christophe Smet

03/11/2020, 1:58 PM
I might have less complex situations, but I just used rx calls and composed them instead of creating a new class.
b

bhatnagarm

03/11/2020, 1:59 PM
Even that's fine there's no standard defined for such things.
But may be you can give it a try, it does it's job really well
6 Views