Synchronize function execution across all users in real-time collaborative applications
useFunctionTogether
hook allows all users to execute the same function simultaneously with the same arguments. When any user calls the synchronized function, all users that are rendering this hook with the same rtKey
will execute their local version of the function at the same time.
useCallback
to prevent unnecessary re-synchronizationsuseStateTogether
for state updates triggered by functionsrtKey
names that indicate the function’s purposeuseStateTogether
- For synchronized state managementuseStateTogetherWithPerUserValues
- For per-user state trackinguseConnectedUsers
- Get information about connected users