-
Notifications
You must be signed in to change notification settings - Fork 114
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
Support for reactive API #332
Comments
What would you use the events for ?
…On Wed., May 15, 2019, 19:43 Wen Wei (Alex) Lin, ***@***.***> wrote:
Having an api that is "life-cycle" aware. where instead of closing the
scopes manually within onDestroy in Android. We should be able to observeOn
the events from TP. E.g OnInjection, OnOpenScope, OnClosingScope,
OnClosedScope etc.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#332?email_source=notifications&email_token=AAN7PXOWQZ5EVX3PSJPSJETPVRDT7A5CNFSM4HNFQ7N2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT7QJXQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN7PXNAPTTO4QUYNDXMGGTPVRDT7ANCNFSM4HNFQ7NQ>
.
|
@stephanenicolas Sorry my wording is a little bit confusing, I reword the description. |
@ww2lin , Hey Alex. It could be an interesting idea. We definitely would have to add this to smoothie-androidx module. IIRC, view models also provide a life cycle observer when the view model is destroyed, this could be used to shutdown what we often refer to as If you feel like contributing it to TP, it would be great. I would suggest that you would create a listener of lifecycle that would take both a scope and a lifecycleowner in constructor param, the listener would close the scope. |
This has been released as part of TP 3.x. Have a look at the smoothie-lifecycle modules. |
Having an api that is "life-cycle" aware. where instead of closing the scopes manually within onDestroy in Android. We should be able to observeOn the events from TP. E.g OnInjection, OnOpenScope, OnClosingScope, OnClosedScope etc.TP should be able to observe on a subject(one example is I'm thinking of is android LifeCycleOwner
myLifecycleOwner.getLifecycle().addObserver(ToothPickObserver());
which then TP will know when to open/close scope.The text was updated successfully, but these errors were encountered: