RXJS如何进行多次点击上次事件?
如何使用RXJ进行上次点击事件,以防止每个按钮点击的多个API调用? 我有一个机制,存在下一个按钮,该按钮会增加客户端##。 如果用户单击以正常速度单击下一个按钮,请接一个地获取下一个客户端插槽数据。但是,如果用户多次又一次地单击一个快速的单击,我不想仅仅显示终于打电话给API,因为它浪费了。由于用户无法遵循屏幕上的数据更改,因此我想根据最后一个递增的客户端##显示最新的点击触发数据。
使用debounctime用法,我可以实现它,但是没有debouncetime用法可以实现吗?
先感谢您。
How can I take the last click event with RxJS to prevent multiple API calls of each button click?
I have a mechanism where exists the next button which increments a clientSlot #.
If the user clicked on the next button with normal speed get the next client slot data one after another. But if the user clicked fast one after another multiple times I would not want to display only the at last because it wasted time calling the APIs. because the user is unable to follow the data changes on the screen, I would like to show the latest click triggered data based on the last incremented clientSlot #.
With debouncTime usage I able to implement it, but without debounceTime usage is it possible to implement?
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让使用 switchmap for -a> - 它将取消不必要的API请求
示例:
您有两个按钮,可以触发API调用。您可以将API调用放入点击事件处理程序中。
Let use switchMap for it - it will cancel unnecessary API requests
Example:
You have two buttons, which trigger API call. You can place API call in click event handler.