Salesforce Lightning Web Component

Salesforce

How to reset lightning-record-edit-form and get also get record id in Salesforce?

Sample Code: HTML: <template>     <lightning-card title="Lead Creation">         <lightning-record-edit-form object-api-name="Lead" onsubmit={handleSubmit} onsuccess={handleSuccess}>             <lightning-messages></lightning-messages>             <lightning-input-field field-name="FirstName"></lightning-input-field>             <lightning-input-field field-name="LastName"></lightning-input-field>             <lightning-input-field field-name="Email"></lightning-input-field>             <lightning-input-field field-name="Phone"></lightning-input-field>             <lightning-input-field field-name="Company"></lightning-input-field> ....

Salesforce

How to subscribe to Platform Event using Lightning Web Component in Salesforce?

HTML: <template> <lightning-card title="EmpApi Example" icon-name="custom:custom14"> <div class="slds-m-around_medium"> <lightning-button variant="success" label="Subscribe" title="Subscribe" onclick={handleSubscribe} disabled={isSubscribeDisabled} class="slds-m-left_x-small"></lightning-button> <lightning-button variant="destructive" label="Unsubscribe" title="Unsubscribe" onclick={handleUnsubscribe} disabled={isUnsubscribeDisabled} class="slds-m-left_x-small"></lightning-button> </div> <lightning-datatable key-field="ReplayId" data={listEvents} columns={columns} hide-checkbox-column="true"> </lightning-datatable> </lightning-card> ....