Hacker News new | past | comments | ask | show | jobs | submit login

Good catch, this should be in the react docs but it's missing. Until then, it's pretty simple. You call `const presence = usePresence({})` and pass in any data you want, and the `presence` value that gets returned is an object that maps client IDs (a unique string for each client) to the values that they passed in to `usePresence`.

Here's an example from the voxel demo: https://github.com/drifting-in-space/driftdb/blob/af64f62b29...

And from the canvas demo: https://github.com/drifting-in-space/driftdb/blob/af64f62b29...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: