-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Child element NOT re-drawing
class APerson extends hyperElement{
onClick(){
this.attrs.hi("Hello from "+this.attrs.name)
} // note/helper : fucntion automatically have the element "this" bound
render(Html){
console.log("Re-draw?")
Html`${this.attrs.name} <button onclick=${this.onClick}>Say hi! ${ this.attrs.x[0].path }</button>`
}
}
class UsersElem extends hyperElement{
setup(onNext){
const Interval = setInterval(onNext(()=> new Date()),1000)
return () => clearInterval(Interval);
}
onHi(val){
alert(val)
}
render(Html,time){
console.log("Draw!")
const yaml = [{path:"foo",data:{}}]
Html`<a-person hi=${this.onHi} x=${yaml} name=${time+""}></a-person>`
}
}
window.customElements.define("a-person", APerson)
window.customElements.define("users-elem", UsersElem)
Metadata
Metadata
Assignees
Labels
No labels