#this is the stuff that I've

1 messages · Page 1 of 1 (latest)

warm mist
#
// in component
const [position, setPosition] = useState()
props.node.onUpdate = (newVal: TreeNode) => { // "subscribe"
  setPosition(newVal)
}
// in class
public onUpdate: (prev: TreeNode) => void = () => {}
public setPosition(newPos: Pos){
  this._position = newPos,
  this.onUpdate(this) 
}

gonna dump this here to make it fair for everyone

edgy rivet
#

thanks

warm mist
edgy rivet
warm mist
#

"some bit of it" 😭

#

well sry my solution didnt work properly

edgy rivet
#

I was lazy to not implement it

#

I implemented the rendering and maintaining state

#

next is updating props and generating the code

warm mist
#

ah ok mb

edgy rivet
#

I got the rendering of the elements and updating the props working

#

now need to add the code generation logic