Pub/Sub API - Jonathan Fox - Dreamforce 2022 - Developer Theatre Recap Session

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ • 7

  • @jefersonspencer
    @jefersonspencer 2 роки тому

    Thanks a lot for sharing this material, it is really easy to follow.

  • @sudharsanc180
    @sudharsanc180 2 роки тому +1

    Love from Bangalore ❤️ 🇮🇳

  • @akashdeep8229
    @akashdeep8229 2 роки тому

    Can we reference this API in LWC components? as existing empAPI don't work outside lightning experience.

    • @JFoxUK
      @JFoxUK  2 роки тому

      Hi!
      I'm not sure what situation you mean? - You can subscribe via empAPI as that doesn't differentiate between Streaming/PubSub as you are defining the Data/Event message you are subscribing to. As you're LWC is on platform, as you would with any other record, your LWC would call and Apex class to either 'publish' a platform event or change a record triggering CDC.
      If this is not the situation you are referencing, are you meaning when using 'Lightning out' otherwise I'm not sure how you're using LWC off platform?

    • @akashdeep8229
      @akashdeep8229 2 роки тому

      @@JFoxUK hey thanks for Prompt response.
      I was asking for the scenario when we want to use empApi in Experience cloud.
      We had a custom LWC based experience cloud site where we wanted to know the CDC event but unfortunately empAPI is not supported in Experience cloud at the moment.
      Hope you got my situation?

    • @JFoxUK
      @JFoxUK  2 роки тому

      @@akashdeep8229 There are workarounds to that where I have seen people try to make a CometD client in an LWC to subscribe etc, though you may be best just using your LWC to poll a record for the change via Apex.

    • @akashdeep8229
      @akashdeep8229 2 роки тому

      @@JFoxUKThanks,
      Yeah, I went through these workarounds.
      CometD : Enterprise won't approve it for Prod because of 3rd party library.
      Polling: This will have significant impact on the performance if we poll using setInterval.
      As Pub/sub api is getting away from cometD I was just guessing if we can use it in LWC like ui/api.