refactor: 优化非 CRUD 代码可读性

This commit is contained in:
Ray.Hao
2026-05-26 19:53:23 +08:00
parent 2a538d7da7
commit bd4413b9f0
11 changed files with 89 additions and 52 deletions

View File

@@ -11,11 +11,11 @@ function createOnlineCountComposable() {
let unsubscribe: (() => void) | null = null;
// 处理在线人数变更消息
const handleOnlineCountMessage = (count: number) => {
if (count !== undefined && !isNaN(count)) {
onlineUserCount.value = count;
lastUpdateTime.value = Date.now();
}
if (!Number.isFinite(count) || count < 0) return;
onlineUserCount.value = count;
lastUpdateTime.value = Date.now();
};
const initialize = () => {