Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 1.42 KB

AURA.md

File metadata and controls

13 lines (10 loc) · 1.42 KB

Aura LWC wrappers

Aura components are used in the project as an exception and only in cases when Aura wrapper is necessary due to some of the API not being ported to LWC yet. For example - the ScoreHubUtility aura component is a wrapper for the scoreHubNotification LWC component due to the fact that lightning:utilityBarAPI isn't available in LWC yet.

ScoreHubUtility

General information

ScoreHubUtility is an Aura wrapper for the scoreHubNotification LWC component. It is necessary because the lightning:utilityBarAPI API which is available in Aura components hasn't been ported yet to LWC.

Technical design

ScoreHubUtility is built around two APIs: lightning:empApi and lightning:utilityBarAPI

  • lightning:empApi is used to intercept AchievementReached__c platform events and to open the utility bar component without user input in case the intercepted event includes information about the current user. See the ScoreHubUtility.cmp onInit() method for more information
  • lightning:utilityBarAPI is used to open the utility bar component automatically when a new event is received and includes data relevant to current user

All data processing and rendering is done in a child scoreHubNotification LWC component