In this post, we would create a Lightning Web Component that can be shared across other LWC as a JavaScript library.
We are going to create LWC Component to acts as a utility method to read query parameter , as shown below
As you can see in above code, we just need to create a JavaScript file & meta file for LWC to act as Javascript library. Also, note how function is defined using keyword export. You can have multiple export methods in same LWC that would be used as library in your project.
To use above method in any LWC component, follow below syntax
Leave a Reply