Guilherme Delgado
1 min readApr 28, 2020

--

Actually Retrofit does it for me here.

If you noticed in my BaseService.kt line 6 I call: response = call.invoke()

That call is a higher-order function received in apiCall. If you continue to follow my example you’ll see that in ChildService.kt I do:

private val api = retrofit.create(Api::class.java) and later apiCall(call = { api.fetchMyObject() }) }

And that’s where the call is being made :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Guilherme Delgado
Guilherme Delgado

Written by Guilherme Delgado

Software Engineer at BlissApplications 🇵🇹 • github.com/GuilhE • When I’m not coding I’m 🧗🏽or 🏄‍♂️

No responses yet

Write a response