RenaudLN / dash_socketio

Other
18 stars 3 forks source link

Refactor to allow callback triggering #4

Closed jimhendy closed 1 month ago

jimhendy commented 1 month ago

Hi @RenaudLN,

Thanks so much for your great work for this component, I have been thinking about mixing dash and socketio for a while but am not smart enough to understand the react side.

Would you consider some changes to the component to allow triggering of callbacks using the socket component?

I would like to be able to use flask-socketio's ability to emit to a subset of connectted users (rooms) to build multiplayer games using dash. This requires triggering callbacks to both receive and emit messages from the client's dash application.

I don't intend this PR to be merged as it breaks existing functionality, I just wanted to present my ideas as code. My proposal can be demoed using the usage_server.py and usage_client.py scripts run at the same time.

A few details that might seem strange:

RenaudLN commented 1 month ago

Hey @jimhendy, I don't understand what the current version of this package doesn't allow you to do. Have you checked some of the examples?

I also built a chatroom example with firestore here https://github.com/RenaudLN/dash-firestore-chat for a bit more comprehensive use.

jimhendy commented 1 month ago

Oops, apologies! I hadn't realised this was already possible. Extra thanks then for this great library!