Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The server itself speaks a very simple WebSocket protocol[1], so it could be used by anything that can speak WebSocket.

The JS/React bindings that implement the actual data sync patterns (shared state, shared reducers, presence) haven’t been ported to Dart (yet?) though.

[1] https://driftdb.com/docs/api



> presence

Congrats on the launch! You have a pointer to docs about presence? Use-case is an ephemeral chatroom where I want to show who's online.


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...




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: