oldergod / android-architecture

MVI architecture Implementation of the ToDo app.
Apache License 2.0
669 stars 70 forks source link

Clear intentsSubject subscription before subscribe to prevent multiple subcriptions #51

Closed wisnup closed 5 years ago

wisnup commented 5 years ago

This PR aim to fix this issue https://github.com/oldergod/android-architecture/issues/49.

Because viewModel.processIntents() is called on fragment's onStart, multiple subscription is possible. Thus, we need to clear the subscription before adding a new one.

oldergod commented 5 years ago

I think the presenter shouldn't have to manage any disposables, and a solution to this problem should live outside. Anyway the original problem is fixed by #52 Thanks you nevertheless