Closed vascanera closed 1 year ago
Result should contain XYZ not ABC.
@alpeshgit, good catch. I updated the code. Thanks!
I'm not sure arrow should be responsible for this (really trying to keep package size down). However, there is no reason you cannot just call the arrow function and mount it yourself. For example:
Instead of:
html`<span class="some-span">XYZ</span>`(, {
action: 'prepend'
});
Just call the arrow function and do whatever DOM manipulation you prefer:
document.querySelector('.some-container').prepend(html`<span class="some-span">XYZ</span>`())
This works already and required no addition bloat 👍
Yes, you are right. The minimalistic mantra of arrow
finally 'clicked' for me. It makes perfect sense not to pollute the library with unnecessary stuff.
Please consider adding a second parameter for the
html
(template) function. This would be useful for all kinds of initial options, like, for instance,action: append | prepend | replace | replaceInner | insertBefore | insertAfter | ...
- whereappend
is the (current) default action, butreplaceInner
would probably be a better fit for default action (as most libs/frameworks work this way).Example code:
Cheers!