November 2020

Salesforce

Salesforce Platform Event Subscription in LWC

Sample code: HTML:<template>    <lightning-card title="EmpApi Example" icon-name="custom:custom14">        <div class="slds-m-around_medium">            <p>Use the buttons below to subscribe and unsubscribe to a streaming channel!</p>            <lightning-input label="Channel Name" value={channelName}                onchange={handleChannelName}></lightning-input>            <lightning-button variant="success" label="Subscribe" title="Subscribe"                onclick={handleSubscribe} ....