Skip to content

Don't update local currentTime state unnecessarily #12

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Following #9: right now, useTimeSynchronization updates both the local roomData.currentTime and the server state:

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

No one assigned

    Labels

    area: game runtimeImprovements to the core game experience.good first issueYou can do this as a way to learn about the code! ❤status: accepting prsThis issue is ready for a pull request.type: cleanupImproving the structural quality of code or runtime smoothness/performance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions