Agenda
This blog gives us a brief, about how we can create a library of one of the most used functionalities of our daily life. ‘ Toast Messages’ and use them over multiple components.
What we are going to do
We are going to create a util Component that serves as a library of toast messages for other components and provide them the functionalities of using toast messages.
Lightning Web Component
Lightning Web Components is lightweight and delivers exceptional performance. Most of the code you write is standard JavaScript and HTML.
For More Info: Go through the Documentation.
So Basically, we are using toast messages to show the custom messages to the user with salesforce standardization. So, In place of using it over and over from the same and different components, we are going to create a Lightning Web Component that serves as the library for the other Lightning Web Components and in place of creating new-new toast messages every time, we just call them and use them instead.And that component will be used as the Util Component.
Util Component:
Test Component:
Blog’s Conclusion:
So, the conclusion of this blog is instead of fetching toast messages for every component differently just create a library and use it. This we reduce the code as well as beautify it.



Very informative
ReplyDeleteThanks for sharing. It is useful.
ReplyDelete