0.0.3
Pre-releaseSummary of changes
This new version brings many changes (and improvements) to the API. We are confident this is getting closer to what a first stable release will be like!
Main changes:
- Dropped all observer methods (
observe(Actions|Mutations|State)()
in favour of a single new concept of externalEffect
(a generic class). As a replacement, now you can callmvflow.observeExternalEffects()
from a new interfaceMVFlowWithEffects
.
This is an improvement because it makes it explicit what things might be exposed externally from one MVFlow object. Making this explicit will make it obvious if something external is relying on implementation details (and turn it to an explicit dependency).
-
Related with the change above, now you can write a
HandlerWithEffects
which is similar to the oldHandler
except it receives one additional lambda that you can call when you want to emit one effect. -
Another big change is changing the way you call
takeView
. Now this method is a suspend function and additionally you need to pass a scope. Internally this scope is used to launch some internal coroutines (one for pushing updates to the view and another to get actions from the view). -
MVFlow
is now just an interface instead of being a class. But you can still callMVFlow(...)
and you get one instance of it although the actual class returned is a private detail and can be different depending on the parameters you send.