You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just recently started using Mosby/MVI within the past month and I have thoroughly enjoyed it so far. So first off I'd like to say thank you!
From the examples I've observed it seems there's some boilerplate that could be removed. All of the view interfaces have one thing in common: the render method. Is there a reason a method like this never made it into an interface? Perhaps one extending MvpView:
Additionally, subscribeViewState seems to always be called at the end of bindIntents, so bindIntents could return the Observable that's passed as the first parameter to subscribeViewState and this call could instead be made internally. So my Presenter would look like the following:
It doesn't remove tons of boilerplate code, but it removes enough where I think it's useful. Also, with this implementation, the mistake of forgetting to call subscribeViewState can't be made.
I'm sure there could be good reason why it hasn't been implemented this way. Any thoughts?
The text was updated successfully, but these errors were encountered:
Hey,
thanks for your feedback! Indeed, there is some "boilerplate" if you implement MVI the way I am doing (and promoting) it. However, I would like to give the user of Mosby the freedom to use this library the way it works best for them and for example I don't want to limit them to use a MviView interface with a render(state) method.
Also, there are plans to add yet another way to implement MVI (MVVM-ish) where an MviView interface doesn't make sense: #247
So for now, I think it makes sense to let the developer (the user of this library) the choice how to implement MVI. Mosby should just offer some convenient classes around general problems like lifecycle and retaining presenters. I think it is not too much work for any developer who wants to use Mosby for MVI based applications to introduce a MviView and AbstractMviPresenter (which is what you have described as MyPresenter in your comment above) in their own app, without having to introduce it in Mosby.
Hi!
I've just recently started using Mosby/MVI within the past month and I have thoroughly enjoyed it so far. So first off I'd like to say thank you!
From the examples I've observed it seems there's some boilerplate that could be removed. All of the view interfaces have one thing in common: the
render
method. Is there a reason a method like this never made it into an interface? Perhaps one extending MvpView:Additionally,
subscribeViewState
seems to always be called at the end ofbindIntents
, sobindIntents
could return theObservable
that's passed as the first parameter tosubscribeViewState
and this call could instead be made internally. So my Presenter would look like the following:It doesn't remove tons of boilerplate code, but it removes enough where I think it's useful. Also, with this implementation, the mistake of forgetting to call
subscribeViewState
can't be made.I'm sure there could be good reason why it hasn't been implemented this way. Any thoughts?
The text was updated successfully, but these errors were encountered: