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

RecyclerView列表多项同时发送请求,如何优雅实现? #239

Open
parcool opened this issue Dec 19, 2023 · 0 comments
Open

RecyclerView列表多项同时发送请求,如何优雅实现? #239

parcool opened this issue Dec 19, 2023 · 0 comments

Comments

@parcool
Copy link

parcool commented Dec 19, 2023

我看到目前demo里的点击播放功能是记录了一个当前点击的position,因为完成任务都是本地的并且是单任务,这是没问题的。
但是,如果有一个todo-list,每个item都有一个完成按钮,这个完成按钮是需要与后台交换的,用户可以在第一个按钮的请求未返回的时候继续点下一个item的完成按钮。各条数据回来后如何找到发送自己的position?
目前我采用的是一个map<Int,Request>,每次新请求就加入它,这样在observe的时候才能知道position,但是感觉不够优雅。
请问如何优雅地解决这类问题?

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