I'm using lit-html to render html templates, but after they've rendered I need to assign a variable to a couple of nodes inside the template result. Currently, the only way I've found to do this is with a dirty timeout like this:
let myInput;
render(myTemplate(myData), myContainer);
setTimeout(() => {
myInput = myContainer.querySelector(".myInput");
}, 0);
Is there a nicer way to do this? It would be awesome if there was a way to assign the variable within the template itself.
Thanks