You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage.md
+1-21
Original file line number
Diff line number
Diff line change
@@ -268,16 +268,13 @@ The listener will be called with a `CursorUpdate`:
268
268
269
269
To set the position of a cursor and emit a `CursorUpdate`, first enter the space:
270
270
271
-
To retrieve the initial position and data of all cursors within a space, you can use the `cursors.getAll()` method. This returns an object keyed by `connectionId` and cursor name. The value is the last `cursorUpdate` set by the given `connectionId`.
272
271
```ts
273
272
space.enter();
274
273
```
275
274
276
-
Example of calling `getAll` to return all cursor positions:
A `CursorUpdate` is an object with 2 properties. `position` is an object with 2 required properties, `x` and `y`. These represent the position of the cursor on a 2D plane. A second optional property, `data` can also be passed. This is an object of any shape and is meant for data associated with the cursor movement (like drag or hover calculation results):
Example of calling `getAll` to get the last positions for the named cursor `slidedeck-cursors`:
311
291
### Initial cursor position and data
312
292
313
293
To retrieve the initial position and data of all cursors within a space, you can use the `space.cursors.getAll()` method. This returns an object keyed by `connectionId`. The value is the last `cursorUpdate` set by the given `connectionId`.
0 commit comments