Skip to content
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

Allow injecting closeable objects into ViewModel #6

Open
skydoves opened this issue Feb 16, 2022 · 1 comment
Open

Allow injecting closeable objects into ViewModel #6

skydoves opened this issue Feb 16, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@skydoves
Copy link
Owner

https://android-review.googlesource.com/c/platform/frameworks/support/+/1984830

Will be updated with the new public API in the next release.


Allow injecting closeable objects into ViewModel

Rather than requiring developers manually override
onCleared() and close any open resources, provide
APIs to allow developers to add one or more
Closeable objects to the ViewModel that will be
closed when the ViewModel is cleared.

As a convenience, provide an additional constructor
for ViewModel that can directly takes one or more
Closeable objects, thus ensuring that injected
parameters can be directly added to the ViewModel.

@skydoves skydoves added the enhancement New feature or request label Feb 16, 2022
@skydoves skydoves self-assigned this Feb 16, 2022
@skydoves
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant