It was just a quickie for fun, but maybe I should look into that
ws.onmessage = function(event) {
const positionIds = new Set(positions.map(pos => pos.id));
Object.keys(cursors).forEach((id) => {
if (!positionIds.has(id)) {
document.body.removeChild(cursors[id]);
delete cursors[id];
}
});
};
Untested but that’s probably pretty close for phone typing