Skip to content

Instantly share code, notes, and snippets.

@simpluslabs
Created November 15, 2018 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simpluslabs/fec0c24487fbab396211e4e62192a594 to your computer and use it in GitHub Desktop.
Save simpluslabs/fec0c24487fbab396211e4e62192a594 to your computer and use it in GitHub Desktop.
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
<lightning:empApi aura:id="empApi" />
<lightning:input aura:id="channel" label="channel" name="channel" type="text" value="/event/Notification__e"/>
<aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
<lightning:button label="Subscribe" onclick="{! c.subscribe }" />
<lightning:button label="Unsubscribe" onclick="{! c.unsubscribe }" />
<aura:attribute name="subscription" type="Map" />
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment