Spaces:
Sleeping
Sleeping
Download composables/useAccountEventBus.ts from asemxin2000/wechat-article: direct link, hf CLI and curl.
- Browser
- Download file 486 Bytes
-
https://huggingface.co/spaces/asemxin2000/wechat-article/resolve/main/composables/useAccountEventBus.ts
- Command line
-
hf download hf://spaces/asemxin2000/wechat-article/composables/useAccountEventBus.ts
-
curl -L -o useAccountEventBus.ts https://huggingface.co/spaces/asemxin2000/wechat-article/resolve/main/composables/useAccountEventBus.ts
486 Bytes
| import { type EventBusKey, useEventBus } from '@vueuse/core'; | |
| const accountEventKey: EventBusKey<string> = Symbol('account-event'); | |
| // 统一的账号相关事件,用于不同组件之间同步状态 | |
| type AccountEvent = 'account-added' | 'account-removed'; | |
| interface AccountEventPayload { | |
| fakeid: string; | |
| } | |
| export default () => { | |
| const accountEventBus = useEventBus<AccountEvent, AccountEventPayload>(accountEventKey); | |
| return { | |
| accountEventBus, | |
| }; | |
| }; | |