|
|
| | Ask HN: Qt style "Signals and Slots" based JavaScript UI library? | |
6 points by tmbsundar 57 days ago | hide | past | favorite | 4 comments
|
| | Are there any equivalent of Qt style loosely coupled "Signals and Slots" based JavaScript UI library? Qt allows widget/ components to be connected to each other with a pub-sub type of system where the emitter of the signal really need not care who the consumer is. While, IIUC, most JS libraries follow a hierarchically coupled state passing system where sharing of state happens through props/ passing down from parent to child components with lifted state etc., Was wondering if there are any JS libraries which operate in the style of Qt event driven signal-slot connections as a primary paradigm. |
|

Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
|
That being said: If you're dead set on this paradigm you can implement this easily yourself. Create a bootstrapping function that modifies a prototype or class in order to provide functions to register signals and slots and use them wherever you need them.
If you use TypeScript you could even use Decorators (e.g. "@Signal" or "@Slot") which are just higher order functions to have some syntactic sugar like the QT macros.