Skip to content

Commit

Permalink
implement MousePosition component to track, emit mouse movements
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshidwivedi committed Jun 20, 2024
1 parent d89e2d0 commit 8492ee8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/room/components/MousePosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useInterval, useMouse } from "react-use";
import {socket} from "@/common/lib/socket";
import {motion} from "framer-motion";

// to track and emit mouse position changes via socket
export const MousePosition = () => {
//setting initial values as 0
const prevPosition = useRef<{x:number, y:number}>({x:0, y:0});
Expand Down

0 comments on commit 8492ee8

Please sign in to comment.