2

This example of using D3 combines the loadScript in the connectedCallback with the code that uses D3, initializeD3 here:

renderedCallback() {
    ...
    Promise.all([
        loadScript(this, D3 + '/d3.v5.min.js'),
        loadStyle(this, D3 + '/style.css')
    ])
        .then(() => {
            this.initializeD3();
        })
    ...
}

I want to use JEXL in multiple components so ideally would just like to import a reference to it where needed and ideally have it pre-cached before first use. (JEXL is working fine inside LWCs.)

What does that look like in LWCs?

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.