I have a flask backend and react front end. I am trying to send data to react every time something specific happens from a third party in backend. I have tried using socketio however data only gets sent to front end if I first sent something from react and used @socket.on for example:
@socketio.on('randomevent')
def handle():
emit("test")
print('x')
So this code works but when i try to do it without:
def handle():
socketio.emit("test")
It doesn't get received in frontend. The flask socketio documentation says that this should work however it doesn't work for me. Any help would be appreciated thanks