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

ViewModel extended from Fragment? #1

Open
ghost opened this issue Sep 28, 2016 · 2 comments
Open

ViewModel extended from Fragment? #1

ghost opened this issue Sep 28, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 28, 2016

Hi, can you explain in two words why you extend ViewModels from Fragment? I analyze many examples with google data binding but is for first time where i see that approach ))

Thanks!

@DanielSerdyukov
Copy link
Owner

Hi!
Extends from fragment to save VM as "retain instance" between configuration changes and get access to lifecycle without any proxy methods

@ghost
Copy link
Author

ghost commented Sep 29, 2016

Got it!
Also:

  1. Would you use this approach in production? At least data binding?
  2. Another way to implement some think like MVVM is with RxJava, wanted to know (if you try it) kind of these ways (rx vs data binding) you find the best option ))

Thanks!

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

No branches or pull requests

1 participant