Consider adding support for lifecycle components
ryanmoelter opened this issue · 0 comments
ryanmoelter commented
We could add support for lifecycle-aware components by implementing LifecycleOwner
in either the Screen
or Navigator
(or both?). Magellan is designed to make things like ViewModels unnecessary, but it would still be nice to have.
[https://developer.android.com/topic/libraries/architecture/lifecycle](Here are the developer docs) for more details.
We may even consider rebuilding screens on top of that lifecycle. I don't particularly like the API (why annotations?) but it might be worth using for a few reasons:
- It's the google-approved way to handle lifecycles
- Other libraries have lifecycle-aware versions
- They have a working implementation of the state machine (
LifecycleRegistry
) that we can use