SlideShare a Scribd company logo
Letterkenny, Ireland
Developers Group
Lk_Sf_Devs LkTrailblazers
Welcome to our virtual learning series
Learn Lightning Web Components in 5 Days
Day 2 - Recap + Decorators, Lifecycle hooks
and Compositions
Nishant Singh Panwar
Community Group Leader
Salesforce Developer and Consultant
● 6 Years of Salesforce Implementation Experience
● 8x Salesforce Certified - Application Architect
UDAIPUR
Nishant_SP
Actions
bit.ly/lwcquery
Sahil Batra (Director @ MTX Group Inc.)
Industry Experience
Having 9 year of experience in IT Industry and 6 years in Salesforce
ecosystem.Started my Salesforce career as Developer and have played
various roles like Technical Lead , Technical Architect and Corporate
Trainer.
Professional Highlights
● Manage Salesforce trainings and certifications.
● Work as Technical Architect / Principal Developer on Projects.
● Hold 5 Salesforce Certifications and 1 Google certification.
● Conducted Training in India, US , Australia and UK.
● Trained 500+ freshers and 300+ lateral folks in Salesforce.
● Trained 800+ students and 250+ faculty members.
Email : sahilbatraa@gmail.com
Twitter : sahilbatraa18
Topics covered in Session 1
● Introduction to LWC
● Why LWC ?
● 2014 Web stack
● 2019 Web Stack
● LWC Framework
● Aura & LWC
● Environment Setup
● LWC Bundle
● Build your First Component
● Applying CSS to Components
● Data Binding
● Conditional Rendering
● Loop & Iteration
Decorators : @track
Demo 3 & 6 : Reactive Private Properties
● Used with Private Property.
● Used if property is Object or an Array.
● All Primitive Type properties are reactive by Default.
● Data Types
○ Primitive Values - No @track Required
○ Objects - require @track
○ Arrays - require @track
Decorators : @api
Demo 7 : Public Properties
● Used with Public Property.
Decorators : @api
Demo 7 : Public Properties Mutation Demo
● Objects passed to components are read only.
● To trigger a mutation use events.
● Use primitive values for public properties
○ Define data shape and no complex documentation is required.
○ Standard HTML element only accept primitive values for attributes.
Public Boolean Properties
Demo 8 : Public Boolean Properties
● By Default value is false.
● Including a attribute value means passing true.
Use getter & setter to modify data
Demo 9 : getter setter properties
● Modify property value
● No need to declare a property
● If you write a setter for public property,you must also write a getter.
● Best practice is to annotate getter with @api. Do not annotate both.
Call Method on Child Component
Demo 10 : Public Methods
● To expose public method expose it with @api
● Parent component can call method to communicate down the hierarchy.
● querySelector() - return first element which matches selector
● querySelectorAll() - return an array of DOM elements.
● Do not use id as HTML template renders id may transformed into global unique
values
Using Slots
Demo 11 : Slots Demo
● Use to pass markup into components
● Similar to facets in Aura
● We have named and unnamed slots
● Do not include more than one unnamed slot
Component Lifecycle
Component
Requested
Constructor is
called
Update Public
Properties
Has public
properties?
Dom Inserted
Connected
Callback
DOM
Rendered
Has Child
Components?
Yes
Yes
Rendered
callback on
Child
Rendered
callback on
Parent
Parent
Removed from
DOM
disconnectedcallback
on Parent
Child removed
from DOM
disconnectedcallback
on Child
Component Lifecycle
● Constructor
○ Fires when component instance is created.
○ DOM manipulation cannot be done as DOM is not inserted yet.
○ Attribute assignment cannot be done.
○ Public properties are also not available
Component Lifecycle
● connectedCallback()
○ Fires when DOM is inserted.
○ You cannot access child elements as it flows from parent to child.
○ Fire more than once during lifecycle if we reorder component.
○ Mostly used for adding up event listeners.
○ DOM manipulation cannot be done as it is not rendered yet.
○ Attribute value assignment can be done here.
○ Flows from Parent to Child.
Component Lifecycle
● renderedCallback()
○ Called on child component first and than on to parent.
○ Use to perform logic after component has finished rendering phase.
○ Is called many times and we use some logic to execute only once.
○ Can create infinite loops.
○ Do not update public properties & tracked properties in renderedCallback()
Component Lifecycle
● disconnectedCallback()
○ Flows from Parent to child.
○ Called when component is removed from the DOM.
Demo 12 : Lifecycle Demo
Post your Queries @ bit.ly/lwcquery
Coming Up
● 14 May - Component communication using events.
bit.ly/lwcday3
● 21 May - Working with Salesforce data including LDS.
bit.ly/lwcday4
● 28 May - Navigation Services, Aura with LWC interoperability & extra topics.
bit.ly/lwcday5
RSVP
Lightning Web Components- Ep 1 - Decorators, Life Cycle Hooks and Compositions

More Related Content

What's hot

Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
Salesforce Developers
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patterns
andyinthecloud
 
Real Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform EventsReal Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform Events
Salesforce Developers
 
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Nidhi Sharma
 
Asynchronous apex
Asynchronous apexAsynchronous apex
Apex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard ProblemsApex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard Problems
Salesforce Developers
 
Lightning web components
Lightning web components Lightning web components
Lightning web components
Cloud Analogy
 
Introduction to lightning components
Introduction to lightning componentsIntroduction to lightning components
Introduction to lightning components
Mohith Shrivastava
 
SOQL in salesforce || Salesforce Object Query Language || Salesforce
SOQL in salesforce || Salesforce Object Query Language || SalesforceSOQL in salesforce || Salesforce Object Query Language || Salesforce
SOQL in salesforce || Salesforce Object Query Language || Salesforce
Amit Singh
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
Salesforce Developers
 
Episode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulersEpisode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulers
Jitendra Zaa
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
Salesforce Developers
 
Apex Design Patterns
Apex Design PatternsApex Design Patterns
Apex Design Patterns
Salesforce Developers
 
Build Reliable Asynchronous Code with Queueable Apex
Build Reliable Asynchronous Code with Queueable ApexBuild Reliable Asynchronous Code with Queueable Apex
Build Reliable Asynchronous Code with Queueable Apex
Salesforce Developers
 
Triggers and order of execution1
Triggers and order of execution1Triggers and order of execution1
Triggers and order of execution1
Prabhakar Sharma
 
Episode 10 - External Services in Salesforce
Episode 10 - External Services in SalesforceEpisode 10 - External Services in Salesforce
Episode 10 - External Services in Salesforce
Jitendra Zaa
 
Using hilt in a modularized project
Using hilt in a modularized projectUsing hilt in a modularized project
Using hilt in a modularized project
Fabio Collini
 
Fast parallel data loading with the bulk API
Fast parallel data loading with the bulk APIFast parallel data loading with the bulk API
Fast parallel data loading with the bulk API
Salesforce Developers
 
Dreamforce 2017 - Advanced Logging Patterns with Platform Events
Dreamforce 2017 - Advanced Logging Patterns with Platform EventsDreamforce 2017 - Advanced Logging Patterns with Platform Events
Dreamforce 2017 - Advanced Logging Patterns with Platform Events
andyinthecloud
 
Introduction to lightning web component
Introduction to lightning web component Introduction to lightning web component
Introduction to lightning web component
Sudipta Deb ☁
 

What's hot (20)

Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patterns
 
Real Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform EventsReal Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform Events
 
Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...Lightning web components - Introduction, component Lifecycle, Events, decorat...
Lightning web components - Introduction, component Lifecycle, Events, decorat...
 
Asynchronous apex
Asynchronous apexAsynchronous apex
Asynchronous apex
 
Apex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard ProblemsApex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard Problems
 
Lightning web components
Lightning web components Lightning web components
Lightning web components
 
Introduction to lightning components
Introduction to lightning componentsIntroduction to lightning components
Introduction to lightning components
 
SOQL in salesforce || Salesforce Object Query Language || Salesforce
SOQL in salesforce || Salesforce Object Query Language || SalesforceSOQL in salesforce || Salesforce Object Query Language || Salesforce
SOQL in salesforce || Salesforce Object Query Language || Salesforce
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Episode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulersEpisode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
Apex Design Patterns
Apex Design PatternsApex Design Patterns
Apex Design Patterns
 
Build Reliable Asynchronous Code with Queueable Apex
Build Reliable Asynchronous Code with Queueable ApexBuild Reliable Asynchronous Code with Queueable Apex
Build Reliable Asynchronous Code with Queueable Apex
 
Triggers and order of execution1
Triggers and order of execution1Triggers and order of execution1
Triggers and order of execution1
 
Episode 10 - External Services in Salesforce
Episode 10 - External Services in SalesforceEpisode 10 - External Services in Salesforce
Episode 10 - External Services in Salesforce
 
Using hilt in a modularized project
Using hilt in a modularized projectUsing hilt in a modularized project
Using hilt in a modularized project
 
Fast parallel data loading with the bulk API
Fast parallel data loading with the bulk APIFast parallel data loading with the bulk API
Fast parallel data loading with the bulk API
 
Dreamforce 2017 - Advanced Logging Patterns with Platform Events
Dreamforce 2017 - Advanced Logging Patterns with Platform EventsDreamforce 2017 - Advanced Logging Patterns with Platform Events
Dreamforce 2017 - Advanced Logging Patterns with Platform Events
 
Introduction to lightning web component
Introduction to lightning web component Introduction to lightning web component
Introduction to lightning web component
 

Similar to Lightning Web Components- Ep 1 - Decorators, Life Cycle Hooks and Compositions

Lightning Web Components- Ep 2 - Component Communication using Events
Lightning Web Components- Ep 2 - Component Communication using EventsLightning Web Components- Ep 2 - Component Communication using Events
Lightning Web Components- Ep 2 - Component Communication using Events
Nishant Singh Panwar
 
Lightning Web Components- Ep 4 - Navigation Services, LWC and Aura Interopera...
Lightning Web Components- Ep 4 - Navigation Services, LWC and Aura Interopera...Lightning Web Components- Ep 4 - Navigation Services, LWC and Aura Interopera...
Lightning Web Components- Ep 4 - Navigation Services, LWC and Aura Interopera...
Nishant Singh Panwar
 
Lightning web components
Lightning web componentsLightning web components
Lightning web components
Amit Chaudhary
 
Angular 2 - An Introduction
Angular 2 - An IntroductionAngular 2 - An Introduction
Angular 2 - An Introduction
NexThoughts Technologies
 
Lightning web components
Lightning web componentsLightning web components
Lightning web components
Amit Chaudhary
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code clean
Brett Child
 
Neoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injectionNeoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injection
Neoito
 
Lightning Web Components- Ep 0 - Introduction
Lightning Web Components- Ep 0 - IntroductionLightning Web Components- Ep 0 - Introduction
Lightning Web Components- Ep 0 - Introduction
Nishant Singh Panwar
 
Kubernetes at Reddit: An Origin Story - KubeCon NA 2018
Kubernetes at Reddit: An Origin Story - KubeCon NA 2018Kubernetes at Reddit: An Origin Story - KubeCon NA 2018
Kubernetes at Reddit: An Origin Story - KubeCon NA 2018
Gregory Taylor
 
Week 1 - ACE.pptx
Week 1 - ACE.pptxWeek 1 - ACE.pptx
Week 1 - ACE.pptx
MazenElnahla
 
Workday Integration Online Training.pdf
Workday Integration Online Training.pdfWorkday Integration Online Training.pdf
Workday Integration Online Training.pdf
SpiritsoftsTraining
 
Symantec - From Early Drupal Adoption to the Latest Drupal Innovations
Symantec - From Early Drupal Adoption to the Latest Drupal InnovationsSymantec - From Early Drupal Adoption to the Latest Drupal Innovations
Symantec - From Early Drupal Adoption to the Latest Drupal Innovations
Tag1 Consulting, Inc.
 
React workshop
React workshopReact workshop
React workshop
Imran Sayed
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
SkyPlanner
 
Flutter workshop @ bang saen 2020
Flutter workshop @ bang saen 2020Flutter workshop @ bang saen 2020
Flutter workshop @ bang saen 2020
Anuchit Chalothorn
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Bhushan Mulmule
 
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
 Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
Daniel Gallego Vico
 
Webcomponents from 0-100 - with Google's Lit
Webcomponents from 0-100 - with Google's LitWebcomponents from 0-100 - with Google's Lit
Webcomponents from 0-100 - with Google's Lit
Filip Bruun Bech-Larsen
 
Advanced Site Studio Class, June 18, 2012
Advanced Site Studio Class, June 18, 2012Advanced Site Studio Class, June 18, 2012
Advanced Site Studio Class, June 18, 2012
Lee Klement
 
High ROI Testing in Angular.pptx
High ROI Testing in Angular.pptxHigh ROI Testing in Angular.pptx
High ROI Testing in Angular.pptx
Christian Lüdemann
 

Similar to Lightning Web Components- Ep 1 - Decorators, Life Cycle Hooks and Compositions (20)

Lightning Web Components- Ep 2 - Component Communication using Events
Lightning Web Components- Ep 2 - Component Communication using EventsLightning Web Components- Ep 2 - Component Communication using Events
Lightning Web Components- Ep 2 - Component Communication using Events
 
Lightning Web Components- Ep 4 - Navigation Services, LWC and Aura Interopera...
Lightning Web Components- Ep 4 - Navigation Services, LWC and Aura Interopera...Lightning Web Components- Ep 4 - Navigation Services, LWC and Aura Interopera...
Lightning Web Components- Ep 4 - Navigation Services, LWC and Aura Interopera...
 
Lightning web components
Lightning web componentsLightning web components
Lightning web components
 
Angular 2 - An Introduction
Angular 2 - An IntroductionAngular 2 - An Introduction
Angular 2 - An Introduction
 
Lightning web components
Lightning web componentsLightning web components
Lightning web components
 
Keeping code clean
Keeping code cleanKeeping code clean
Keeping code clean
 
Neoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injectionNeoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injection
 
Lightning Web Components- Ep 0 - Introduction
Lightning Web Components- Ep 0 - IntroductionLightning Web Components- Ep 0 - Introduction
Lightning Web Components- Ep 0 - Introduction
 
Kubernetes at Reddit: An Origin Story - KubeCon NA 2018
Kubernetes at Reddit: An Origin Story - KubeCon NA 2018Kubernetes at Reddit: An Origin Story - KubeCon NA 2018
Kubernetes at Reddit: An Origin Story - KubeCon NA 2018
 
Week 1 - ACE.pptx
Week 1 - ACE.pptxWeek 1 - ACE.pptx
Week 1 - ACE.pptx
 
Workday Integration Online Training.pdf
Workday Integration Online Training.pdfWorkday Integration Online Training.pdf
Workday Integration Online Training.pdf
 
Symantec - From Early Drupal Adoption to the Latest Drupal Innovations
Symantec - From Early Drupal Adoption to the Latest Drupal InnovationsSymantec - From Early Drupal Adoption to the Latest Drupal Innovations
Symantec - From Early Drupal Adoption to the Latest Drupal Innovations
 
React workshop
React workshopReact workshop
React workshop
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Flutter workshop @ bang saen 2020
Flutter workshop @ bang saen 2020Flutter workshop @ bang saen 2020
Flutter workshop @ bang saen 2020
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
 Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
Droidcon Spain 2016 - The Pragmatic Android Programmer: from hype to reality
 
Webcomponents from 0-100 - with Google's Lit
Webcomponents from 0-100 - with Google's LitWebcomponents from 0-100 - with Google's Lit
Webcomponents from 0-100 - with Google's Lit
 
Advanced Site Studio Class, June 18, 2012
Advanced Site Studio Class, June 18, 2012Advanced Site Studio Class, June 18, 2012
Advanced Site Studio Class, June 18, 2012
 
High ROI Testing in Angular.pptx
High ROI Testing in Angular.pptxHigh ROI Testing in Angular.pptx
High ROI Testing in Angular.pptx
 

More from Nishant Singh Panwar

Admin Certification Sales and Service Cloud
Admin Certification Sales and Service CloudAdmin Certification Sales and Service Cloud
Admin Certification Sales and Service Cloud
Nishant Singh Panwar
 
Letterkenny TrailheaDX 2020 Global Gathering
Letterkenny TrailheaDX 2020 Global GatheringLetterkenny TrailheaDX 2020 Global Gathering
Letterkenny TrailheaDX 2020 Global Gathering
Nishant Singh Panwar
 
Salesforce Admin Certification Preparation : Security Model Dive In
Salesforce Admin Certification Preparation : Security Model Dive InSalesforce Admin Certification Preparation : Security Model Dive In
Salesforce Admin Certification Preparation : Security Model Dive In
Nishant Singh Panwar
 
Differential Salesforce DX - Virtual Dreamin
Differential Salesforce DX - Virtual DreaminDifferential Salesforce DX - Virtual Dreamin
Differential Salesforce DX - Virtual Dreamin
Nishant Singh Panwar
 
Power of Flows and Prepare for Salesforce Admin Certification
Power of Flows and Prepare for Salesforce Admin CertificationPower of Flows and Prepare for Salesforce Admin Certification
Power of Flows and Prepare for Salesforce Admin Certification
Nishant Singh Panwar
 
Salesforce Spring 20 Highlights
Salesforce Spring 20 HighlightsSalesforce Spring 20 Highlights
Salesforce Spring 20 Highlights
Nishant Singh Panwar
 
Letterkenny Developer Group Meet - 28 Jan 2020
Letterkenny Developer Group Meet - 28 Jan 2020Letterkenny Developer Group Meet - 28 Jan 2020
Letterkenny Developer Group Meet - 28 Jan 2020
Nishant Singh Panwar
 
Lkdug meet 17_dec19
Lkdug meet 17_dec19Lkdug meet 17_dec19
Lkdug meet 17_dec19
Nishant Singh Panwar
 

More from Nishant Singh Panwar (8)

Admin Certification Sales and Service Cloud
Admin Certification Sales and Service CloudAdmin Certification Sales and Service Cloud
Admin Certification Sales and Service Cloud
 
Letterkenny TrailheaDX 2020 Global Gathering
Letterkenny TrailheaDX 2020 Global GatheringLetterkenny TrailheaDX 2020 Global Gathering
Letterkenny TrailheaDX 2020 Global Gathering
 
Salesforce Admin Certification Preparation : Security Model Dive In
Salesforce Admin Certification Preparation : Security Model Dive InSalesforce Admin Certification Preparation : Security Model Dive In
Salesforce Admin Certification Preparation : Security Model Dive In
 
Differential Salesforce DX - Virtual Dreamin
Differential Salesforce DX - Virtual DreaminDifferential Salesforce DX - Virtual Dreamin
Differential Salesforce DX - Virtual Dreamin
 
Power of Flows and Prepare for Salesforce Admin Certification
Power of Flows and Prepare for Salesforce Admin CertificationPower of Flows and Prepare for Salesforce Admin Certification
Power of Flows and Prepare for Salesforce Admin Certification
 
Salesforce Spring 20 Highlights
Salesforce Spring 20 HighlightsSalesforce Spring 20 Highlights
Salesforce Spring 20 Highlights
 
Letterkenny Developer Group Meet - 28 Jan 2020
Letterkenny Developer Group Meet - 28 Jan 2020Letterkenny Developer Group Meet - 28 Jan 2020
Letterkenny Developer Group Meet - 28 Jan 2020
 
Lkdug meet 17_dec19
Lkdug meet 17_dec19Lkdug meet 17_dec19
Lkdug meet 17_dec19
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 

Lightning Web Components- Ep 1 - Decorators, Life Cycle Hooks and Compositions

  • 1. Letterkenny, Ireland Developers Group Lk_Sf_Devs LkTrailblazers Welcome to our virtual learning series Learn Lightning Web Components in 5 Days Day 2 - Recap + Decorators, Lifecycle hooks and Compositions
  • 2.
  • 3. Nishant Singh Panwar Community Group Leader Salesforce Developer and Consultant ● 6 Years of Salesforce Implementation Experience ● 8x Salesforce Certified - Application Architect UDAIPUR Nishant_SP
  • 5. Sahil Batra (Director @ MTX Group Inc.) Industry Experience Having 9 year of experience in IT Industry and 6 years in Salesforce ecosystem.Started my Salesforce career as Developer and have played various roles like Technical Lead , Technical Architect and Corporate Trainer. Professional Highlights ● Manage Salesforce trainings and certifications. ● Work as Technical Architect / Principal Developer on Projects. ● Hold 5 Salesforce Certifications and 1 Google certification. ● Conducted Training in India, US , Australia and UK. ● Trained 500+ freshers and 300+ lateral folks in Salesforce. ● Trained 800+ students and 250+ faculty members. Email : sahilbatraa@gmail.com Twitter : sahilbatraa18
  • 6. Topics covered in Session 1 ● Introduction to LWC ● Why LWC ? ● 2014 Web stack ● 2019 Web Stack ● LWC Framework ● Aura & LWC ● Environment Setup ● LWC Bundle ● Build your First Component ● Applying CSS to Components ● Data Binding ● Conditional Rendering ● Loop & Iteration
  • 7. Decorators : @track Demo 3 & 6 : Reactive Private Properties ● Used with Private Property. ● Used if property is Object or an Array. ● All Primitive Type properties are reactive by Default. ● Data Types ○ Primitive Values - No @track Required ○ Objects - require @track ○ Arrays - require @track
  • 8. Decorators : @api Demo 7 : Public Properties ● Used with Public Property.
  • 9. Decorators : @api Demo 7 : Public Properties Mutation Demo ● Objects passed to components are read only. ● To trigger a mutation use events. ● Use primitive values for public properties ○ Define data shape and no complex documentation is required. ○ Standard HTML element only accept primitive values for attributes.
  • 10. Public Boolean Properties Demo 8 : Public Boolean Properties ● By Default value is false. ● Including a attribute value means passing true.
  • 11. Use getter & setter to modify data Demo 9 : getter setter properties ● Modify property value ● No need to declare a property ● If you write a setter for public property,you must also write a getter. ● Best practice is to annotate getter with @api. Do not annotate both.
  • 12. Call Method on Child Component Demo 10 : Public Methods ● To expose public method expose it with @api ● Parent component can call method to communicate down the hierarchy. ● querySelector() - return first element which matches selector ● querySelectorAll() - return an array of DOM elements. ● Do not use id as HTML template renders id may transformed into global unique values
  • 13. Using Slots Demo 11 : Slots Demo ● Use to pass markup into components ● Similar to facets in Aura ● We have named and unnamed slots ● Do not include more than one unnamed slot
  • 14. Component Lifecycle Component Requested Constructor is called Update Public Properties Has public properties? Dom Inserted Connected Callback DOM Rendered Has Child Components? Yes Yes Rendered callback on Child Rendered callback on Parent Parent Removed from DOM disconnectedcallback on Parent Child removed from DOM disconnectedcallback on Child
  • 15. Component Lifecycle ● Constructor ○ Fires when component instance is created. ○ DOM manipulation cannot be done as DOM is not inserted yet. ○ Attribute assignment cannot be done. ○ Public properties are also not available
  • 16. Component Lifecycle ● connectedCallback() ○ Fires when DOM is inserted. ○ You cannot access child elements as it flows from parent to child. ○ Fire more than once during lifecycle if we reorder component. ○ Mostly used for adding up event listeners. ○ DOM manipulation cannot be done as it is not rendered yet. ○ Attribute value assignment can be done here. ○ Flows from Parent to Child.
  • 17. Component Lifecycle ● renderedCallback() ○ Called on child component first and than on to parent. ○ Use to perform logic after component has finished rendering phase. ○ Is called many times and we use some logic to execute only once. ○ Can create infinite loops. ○ Do not update public properties & tracked properties in renderedCallback()
  • 18. Component Lifecycle ● disconnectedCallback() ○ Flows from Parent to child. ○ Called when component is removed from the DOM. Demo 12 : Lifecycle Demo
  • 19. Post your Queries @ bit.ly/lwcquery
  • 20. Coming Up ● 14 May - Component communication using events. bit.ly/lwcday3 ● 21 May - Working with Salesforce data including LDS. bit.ly/lwcday4 ● 28 May - Navigation Services, Aura with LWC interoperability & extra topics. bit.ly/lwcday5 RSVP