I have the following ELM view element:
Html.node "test-elem"
[ Attributes.attribute "data-count" (model.count |> String.fromInt) ]
[]
test-elem is a custom html element:
constructor() {
super();
this.me = this;
}
connectedCallback() {
console.info(this.dataset.count);
this.div = document.createElement("div");
this.appendChild(this.div);
this.div.innerText = "" + this.dataset.count;
}
attributeChangedCallback() {
console.info(this.dataset.count);
this.div.innerText = "" + this.dataset.count;
}
If model.count changes the custom element does not get regenerated. How do I force this?
https://ellie-app.com/6SRrZjCzwfra1
Edited with suggestions from @Robin, but no luck.