I have an LWC in which I want to use EMP API. Docs say that's only currently available in Aura. Do I have to wrap my entire LWC in aura in order to add the EMP API, or can I create a utility aura component and do pub-sub to/from the LWC?
I have an LWC in which I want to use EMP API. Docs say that's only currently available in Aura. Do I have to wrap my entire LWC in aura in order to add the EMP API, or can I create a utility aura component and do pub-sub to/from the LWC?
Best Answer
Summer 19 is 1 week away, but that won't stop you from preparing it beforehand in your Summer 19 Sandbox or Scratch org.
lightning:empApi does not show LWC button as enabled as its referring to the Spring version of docs.
Also , the release notes dont tell us about how to use empAPI in LWC. I could not find any public documentation on about how to use it.
A quick way to refer docs of lwc is Summer 19 org is to visit the url
Sample Example :
JS: