I have a case where a template literal can resolve a variable immediately, but the next in order doesn't. I have to wait for a response. It looks like this:
const firstValue = 'firstItemName'
const myTemplate = `
First item: ${firstValue} is available! But not the second: ${secondValue}
`;
const secondValue = 'secondItemName';
This secondValue
will come, in my case, from a Promise
call. Is there no way to use the string literal as a reference instead as final value?