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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典消息别名(向后兼容)
|
||||
*/
|
||||
export type DictMessage = DictChangeMessage;
|
||||
|
||||
/**
|
||||
* 字典变更事件回调函数类型
|
||||
*/
|
||||
@@ -158,6 +163,11 @@ function createDictSyncComposable() {
|
||||
cleanup,
|
||||
onDictChange,
|
||||
|
||||
// 别名方法(向后兼容)
|
||||
initWebSocket: initialize,
|
||||
closeWebSocket: cleanup,
|
||||
onDictMessage: onDictChange,
|
||||
|
||||
// 用于测试和调试
|
||||
handleDictChangeMessage,
|
||||
};
|
||||
|
||||
@@ -160,6 +160,10 @@ function createOnlineCountComposable() {
|
||||
// 方法
|
||||
initialize,
|
||||
cleanup,
|
||||
|
||||
// 别名方法(向后兼容)
|
||||
initWebSocket: initialize,
|
||||
closeWebSocket: cleanup,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user