cocopon / tweakpane

:control_knobs: Compact GUI for fine-tuning parameters and monitoring value changes
https://tweakpane.github.io/docs/
MIT License
3.69k stars 92 forks source link

Support for signals #425

Closed pspeter3 closed 2 years ago

pspeter3 commented 2 years ago

I just saw Preact released a signals library that is UI independent. The signals are basically an object with a value property. I was wondering what the best way would be to connect them to Tweakpane?

cocopon commented 2 years ago

I'm not a Preact user, but if it is just an object with a value property, is there any problem with pane.addInput(signal, 'value') ? More concrete problem or example codes can be useful for the discussion.

pspeter3 commented 2 years ago

You're totally right. I thought that this wouldn't work with the proxies but it passing the signal as the first property works great. The only thing is to remember to pass the label property as well. Thank you so much!