Skip to content

Commit

Permalink
refactor(eventBus): 调整命名
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenyuWang committed Sep 4, 2024
1 parent 735d2d9 commit 752f9fc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/uni-api/src/service/base/eventBus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ import {
OnProtocol,
OnceProtocol,
} from '../../protocols/base/eventBus'
import type { EventBus } from '@dcloudio/uni-app-x/types/uni'

type EventStopHandler = () => void

export class UniEventBus implements EventBus {
export class EventBus {
private $emitter = new Emitter()
on(name: string, callback: Function) {
this.$emitter.on(name, callback)
Expand All @@ -39,7 +38,7 @@ export class UniEventBus implements EventBus {
}
}

const eventBus = new UniEventBus()
const eventBus = new EventBus()
export const $on = defineSyncApi<API_TYPE_ON>(
API_ON,
(name, callback): EventStopHandler => {
Expand Down

0 comments on commit 752f9fc

Please sign in to comment.