-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
area: game runtimeImprovements to the core game experience.Improvements to the core game experience.good first issueYou can do this as a way to learn about the code! ❤You can do this as a way to learn about the code! ❤status: accepting prsThis issue is ready for a pull request.This issue is ready for a pull request.type: cleanupImproving the structural quality of code or runtime smoothness/performance.Improving the structural quality of code or runtime smoothness/performance.
Description
Following #9: right now, useTimeSynchronization updates both the local roomData.currentTime and the server state:
karaokenite-react/src/pages/room/RoomEvents/useVideoControls/useTimeSynchronization.ts
Lines 16 to 20 in 6c26f5c
| useInterval(() => { | |
| emitRoomData({ | |
| currentTime: videoElement.currentTime, | |
| }); | |
| }, videoElementSyncInterval); |
Nothing in local UI should actually subscribes to currentTime... and even if we do add something that does, we already receive updates from the server whenever currentTime or any other room data updates.
Proposal: as a performance improvement, emit the new currentTime to the server directly, without also setting it in React state.
Metadata
Metadata
Assignees
Labels
area: game runtimeImprovements to the core game experience.Improvements to the core game experience.good first issueYou can do this as a way to learn about the code! ❤You can do this as a way to learn about the code! ❤status: accepting prsThis issue is ready for a pull request.This issue is ready for a pull request.type: cleanupImproving the structural quality of code or runtime smoothness/performance.Improving the structural quality of code or runtime smoothness/performance.