dmotz / trystero

✨🤝✨ Build instant multiplayer webapps, no server required — Magic WebRTC matchmaking over BitTorrent, Nostr, MQTT, IPFS, Supabase, and Firebase

Home Page:https://oxism.com/trystero

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] - Make joinRoom and makeAction suitable for use as React Hooks.

rogersanick opened this issue · comments

Make joinRoom and makeAction idempotent so that they can be used as React hooks!

commented

This should be relatively well-doable. Create some custom hooks with the makeAction() code: https://react.dev/learn/reusing-logic-with-custom-hooks

And include a closure variable that checks if the function with the same parameters has already been called for a specific peerId.