我可以替换LWC中平台事件的功能吗?

发布于 2025-01-29 19:21:21 字数 72 浏览 3 评论 0 原文

我有一个可与事件平台一起使用的LWC,但是超过了事件限制,我无法减少它们。是否有任何功能或方法可以实时刷新我的组件而没有平台事件?

I have a lwc that works with Event Platforms, but event limits are exceeded and I can't reduce them. Is there any functionality or method that can refresh my component in real time without platform events?.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

つ低調成傷 2025-02-05 19:21:21

有时钱是一个答案,请考虑购买增加极限。

如果是1个组件与同一页面上的另一个组件交谈并将其告诉rerender-请查看闪电消息服务。它不是完美的(无法在手机上工作),但对您来说足够好。

当所有其他方法失败时 - 考虑手工投票。如果您使用window.setTimeOut()并调用Apex函数每5秒说一次检查内容是否更改了怎么办。它将是网络密集型的,但可能足以获取新的数据。

Sometimes money is an answer, consider buying an addon to increase the limit.

If it's 1 component talking to another component on same page and telling it to rerender - look into Lightning Message Service. It's not perfect (couldn't get it to work on mobile) but could be good enough for you.

When all else fails - consider handmade polling. What if you use window.setTimeout() and call apex function say every 5 seconds to check if stuff changed. It'll be network-intensive but could be good enough to fetch fresh data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文