-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detecting if presenter is attached on a BaseRxInteractor #46
Comments
I'm sorry but I can't get your usecase. First of all, you don't need to call I understand that the code you attached is just an example, but to avoid any potential problems in your production code - what do you want to achieve through wrapping a If this comment doesn't answer your question, provide me more context and more specific usecase please. |
Sorry the initial question was a little rushed. I've cleanup up the code to give a better example. You were right that the getAPIData() was redundant when not grooming the data for the Presenter. I just wanted to mention that in the case where the view and presenter is detached (and therefore the subscriber is disposed because of the addSubscription) while the interactor was doing async work to prepare the presenter data, it would crash without a check for disposed. So in this scenario, I was wondering whether it would be prudent to have a isPresenterAttached() function anyway? |
I'm still not sure if I get you correctly, but the Interactor won't crash after the Presenter disposal. The Interactor in the Rx flavor of this lib shall not have reference to the Presenter, so Presenter actions shall not influence it. Moreover, if the Observer gets disposed via the |
Appreciate your response, thank you. |
Hi,
I think I can understand why a BaseRxInteractor needs no
isPresenterAttached()
logic as with BaseInteractor. However, in the case where one had a Presenter that had an addSubscription:We have found that we required similar checks for
subscriber.isDisposed()
on any async work.For example:
In light of this do you think the BaseRxInteractor should have some kind of
isPresenterAttached()
logic?The text was updated successfully, but these errors were encountered: