Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add presence hook and barebones demo to test it #15

Merged
merged 10 commits into from Jul 27, 2023

Conversation

paulgb
Copy link
Member

@paulgb paulgb commented Jul 27, 2023

Adds a presence hook. Keeps the existing awareness hook to obtain the raw Awareness value (useful for passing to components like CodeMirror), but adds a usePresence hook that works like we discussed.

The demo is just there to confirm that it works; feel free to run with it and turn it into something cooler.

@linear
Copy link

linear bot commented Jul 27, 2023

DIS-1135 Add presence hook to React library

Should work like:

const [presence, setMyPresence] = usePresence()
// presence is a yjs "awareness" object
setMyPresence({cursorX: 4, cursorY: 9})

@vercel
Copy link

vercel bot commented Jul 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
y-serve-demos ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 27, 2023 8:30pm

…thub.com:drifting-in-space/y-serve into paul/dis-1135-add-presence-hook-to-react-library
@paulgb paulgb merged commit 9acc311 into main Jul 27, 2023
8 checks passed
@paulgb paulgb deleted the paul/dis-1135-add-presence-hook-to-react-library branch July 27, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants