Sign up for Hasura Newsletter
Loading...

Apollo useSubscription React hook

将实时数据带入您的用户界面的最容易的方式,是使用 Apollo React-Hook 的 useSubscription React hook。这让您可以在组件的呈现函数中直接呈现来自服务的数据流!需要注意的是,订阅只是监听器,它们在第一次连接时不会请求任何数据,只会打开连接以获得新的数据。

Did you find this page helpful?
Start with GraphQL on Hasura for Free
  • ArrowBuild apps and APIs 10x faster
  • ArrowBuilt-in authorization and caching
  • Arrow8x more performant than hand-rolled APIs
Promo
footer illustration
Brand logo
© 2024 Hasura Inc. All rights reserved
Github
Titter
Discord
Facebook
Instagram
Youtube
Linkedin