@roomful/solid
v1.6.4
Published
SolidJS provider and signal hooks for Roomful — realtime presence, cursors, shared state, viewport, locking, pointer, comments, and history.
Downloads
1,791
Readme
@roomful/solid
SolidJS bindings for Roomful — a provider plus fine-grained primitives for real-time presence, cursors, shared state, awareness, events, viewport sync, laser pointer, locks, comments, and history.
Stable — v1.5. Realtime presence, cursors, and shared state, plus the collaboration primitives (
useViewport,useLocks,usePointer,useComments,useHistory). The API is stable and ready for production.
Install
npm install @roomful/core @roomful/solidUsage
import { RoomfulProvider, usePresence, useSharedState } from '@roomful/solid';
function App() {
return (
<RoomfulProvider roomId="my-room" presence={{ name: 'Alice' }}>
<Room />
</RoomfulProvider>
);
}
function Room() {
const { others } = usePresence();
const [count, setCount] = useSharedState('count', { initialValue: 0 });
return (
<button onClick={() => setCount(count() + 1)}>
{count()} · {others().length} others here
</button>
);
}Primitives: useRoom, usePresence, useCursors, useSharedState, useAwareness, useEvent, usePeers, useConnectionStatus. v1.5 collaboration primitives: useViewport, useLocks (plus useLockState), usePointer, useComments, useHistory — see the reference docs. Reactive values are returned as Solid accessors, and RoomfulProvider accepts onConnect, onDisconnect, and onError lifecycle callbacks.
Documentation
See the Roomful repository for the full API reference.
License
MIT
