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
集成Paging3时,paging3 不生效,无法进行网络请求操作 #4
Comments
// dispatcher 可以看看此处的 testRepo.getTestList() 后边是否遗漏了 .cachedIn(viewModelScope) 所致, 另外 paging 有自己独立的 flow 作为返回,适合传统方式使用, (对此可参考 complexRequest 案例: |
和这个没关系的。 主要原因还是在 viewModelScope 作用域中并不能成功消费 PagingData,只能在 Activity 或者 Fragment 中 collect 才会触发paging3中数据请求,因此在 Dispatcher 中也无法分发 PagingData。
这个案例用在 PagingData 的回推也是无效。 |
感谢反馈,暂时建议传统方式。后续如有破局的好招,欢迎随时补充。 |
在项目中集成 Paging 3,但用在这个框架里发现并不能触发请求操作,参考代码如下:
如果用传统的 ViewModel 测试是没问题,可以触发,参考代码如下:
The text was updated successfully, but these errors were encountered: