Nucleus is an Android library, which utilizes the Model-View-Presenter pattern to properly connect background tasks with visual parts of an application.
MIT License
1.98k
stars
253
forks
source link
Wondering about multiple Presenter endpoint calls (Question) #132
I've got two calls in Presenter, each wrapped in a restartableLatestCache. First one is a authentication against a webservice using restrofit, the second is fetching profile data using a token which is retrived from the authentication.
Basically i start the REQUEST_LOGIN on btnClick and on success I kick off the REQUEST_ACCOUNT onAuthenticateSuccess. The issue I'm having is that REQUEST_ACCOUNT starts off before onAuthenticate is done...
I'm overall wondering if this is the way to go in the Presenter if you have multiple endpoint calls?
I've got two calls in Presenter, each wrapped in a restartableLatestCache. First one is a authentication against a webservice using restrofit, the second is fetching profile data using a token which is retrived from the authentication.
Basically i start the REQUEST_LOGIN on btnClick and on success I kick off the REQUEST_ACCOUNT
onAuthenticateSuccess
. The issue I'm having is that REQUEST_ACCOUNT starts off before onAuthenticate is done...I'm overall wondering if this is the way to go in the Presenter if you have multiple endpoint calls?
This is what my Presenter looks like
Presenter
Activity