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

数据源LiveData不在ViewModel里? #20

Open
ukyo6 opened this issue Jul 29, 2019 · 1 comment
Open

数据源LiveData不在ViewModel里? #20

ukyo6 opened this issue Jul 29, 2019 · 1 comment

Comments

@ukyo6
Copy link

ukyo6 commented Jul 29, 2019

如果数据源的LiveData不在ViewModel里, 那么configChange以后, Activity重建后, 也无法从ViewModel里获取到数据, 还要重新请求. 直接通过ViewModel来调用Repository通过LiveDataBus发送数据感觉和MVP的思想是一样的. ViewModel里并没有保存数据啊

@JitMaos
Copy link

JitMaos commented Apr 22, 2021

如果数据源的LiveData不在ViewModel里, 那么configChange以后, Activity重建后, 也无法从ViewModel里获取到数据, 还要重新请求. 直接通过ViewModel来调用Repository通过LiveDataBus发送数据感觉和MVP的思想是一样的. ViewModel里并没有保存数据啊

+1

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

2 participants