mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
fix: typo (#28724)
* fix: typo * fix: prettier --------- Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
This commit is contained in:
1 parent
e77f8b9f39
commit
90ed06bf19
1 file changed
+12
-15
@@ -89,16 +89,14 @@ const MOUSE_EVENT = 'cursor'
|
||||
// Subscribe to mouse events.
|
||||
// Our second parameter filters only for mouse events.
|
||||
channel
|
||||
.on(
|
||||
'broadcast',
|
||||
{ event: MOUSE_EVENT },
|
||||
(event) => { receivedCursorPosition(event) }
|
||||
)
|
||||
.subscribe()
|
||||
.on('broadcast', { event: MOUSE_EVENT }, (event) => {
|
||||
receivedCursorPosition(event)
|
||||
})
|
||||
.subscribe()
|
||||
|
||||
// Handle a mouse event.
|
||||
const receivedCursorPosition({ event, payload }) => {
|
||||
console.log(`
|
||||
const receivedCursorPosition = ({ event, payload }) => {
|
||||
console.log(`
|
||||
User: ${payload.userId}
|
||||
x Position: ${payload.x}
|
||||
y Position: ${payload.y}
|
||||
@@ -106,14 +104,13 @@ const receivedCursorPosition({ event, payload }) => {
|
||||
}
|
||||
|
||||
// Helper function for sending our own mouse position.
|
||||
const sendMousePosition(channel, userId, x, y) => {
|
||||
return channel.send({
|
||||
type: 'broadcast',
|
||||
event: MOUSE_EVENT,
|
||||
payload: { userId, x, y }
|
||||
})
|
||||
const sendMousePosition = (channel, userId, x, y) => {
|
||||
return channel.send({
|
||||
type: 'broadcast',
|
||||
event: MOUSE_EVENT,
|
||||
payload: { userId, x, y },
|
||||
})
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Presence Example
|
||||
|
||||
Reference in new issue
Block a user