feat(websocket): add backward compatible aliases for dict and online count composables
This commit is contained in:
@@ -12,6 +12,11 @@ export interface DictChangeMessage {
|
|||||||
timestamp: number;
|
timestamp: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典消息别名(向后兼容)
|
||||||
|
*/
|
||||||
|
export type DictMessage = DictChangeMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典变更事件回调函数类型
|
* 字典变更事件回调函数类型
|
||||||
*/
|
*/
|
||||||
@@ -158,6 +163,11 @@ function createDictSyncComposable() {
|
|||||||
cleanup,
|
cleanup,
|
||||||
onDictChange,
|
onDictChange,
|
||||||
|
|
||||||
|
// 别名方法(向后兼容)
|
||||||
|
initWebSocket: initialize,
|
||||||
|
closeWebSocket: cleanup,
|
||||||
|
onDictMessage: onDictChange,
|
||||||
|
|
||||||
// 用于测试和调试
|
// 用于测试和调试
|
||||||
handleDictChangeMessage,
|
handleDictChangeMessage,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -160,6 +160,10 @@ function createOnlineCountComposable() {
|
|||||||
// 方法
|
// 方法
|
||||||
initialize,
|
initialize,
|
||||||
cleanup,
|
cleanup,
|
||||||
|
|
||||||
|
// 别名方法(向后兼容)
|
||||||
|
initWebSocket: initialize,
|
||||||
|
closeWebSocket: cleanup,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user