1.1.4 • Published 2 years ago
use-y-js v1.1.4
useYjs
A custom hook simplifies to create of a CRDT document.
Manual
1.Start a signaling y-websocket server
PORT=4444 npx y-websocket
Read more: y-websocket
2.Intall use-y-js
npm install use-y-js
3.Import hook and start coding
import { useYjs } from "use-y-js";
// ...
const { data, updateData, userInfoMap, updateFieldLocalUserInfo } = useYjs({
signaling: "ws://localhost:4444",
roomName: "your-room-name",
// use for auth
params: {
token: "anthing"
}
// POJO
initData: {
title: "Doc title",
content: "Doc content"
},
// POJO
initUserInfo: {
name: "Rio",
color: "#166f9c",
pointerLocation: {
x: 100,
y: 200
}
},
// Minimum time until the next userInfo data sync, defaultValue = 250
intervalSyncTime: 300
});
1.1.4
2 years ago
1.1.1-alpha-8
2 years ago
1.1.1-alpha-7
2 years ago
1.1.1-alpha-6
2 years ago
1.1.1-alpha-5
2 years ago
1.1.1-alpha-4
2 years ago
1.1.1-alpha-3
2 years ago
1.1.1-alpha-2
2 years ago
1.1.1-alpha-1
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago