Ive brought this up with other developers, and they say while there is no obvious way forward, it seems that they all have an idea of how to go about it.
Is there any way I can implement signals and slots javascript and or typescript? I want to get as close to this functionality as possible: https://doc.qt.io/qt-5/signalsandslots.html
And a code example to demonstrate what I mean:
#include <QObject>
class Label : public QObject
{
Q_OBJECT
public:
Label( QObject *parent=nullptr );
QString label()
{
return removePlaceholders(m_Label);
}
void setLabel(QString label)
{
m_Label = label;
emit labelChanged(label);
}
signals:
void labelChanged(QString label);
private:
QString m_Label;
};
which can be utilized like so:
Label label;
QEventLoop waitForLabel;
connect(&label, &Label::labelChanged, &waitForLabel, &QEventLoop::quit);
waitForLabel.exec; // Now the thread can not move past this point,
// will have to wait for the signal Label::labelChanged to be emitted
// from the Label::setLabel function in the label object.