Skip to content

Commit 4c9bbb8

Browse files
authored
Merge pull request #92 from wadetandy/master
Fix eventbus import
2 parents 5b6b1fa + 1e7374b commit 4c9bbb8

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/event-bus.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
export interface IAddListener {
2-
(key: string, callback: Function): void
3-
}
1+
export type IAddListener = (key: string, callback: Function) => void
42

5-
export interface IRemoveListener {
6-
(key: string, callback: Function): void
7-
}
3+
export type IRemoveListener = (key: string, callback: Function) => void
84

9-
export interface IDispatch {
10-
(key: string, context: any, value: any): void
11-
}
5+
export type IDispatch = (key: string, context: any, value: any) => void
126

137
export interface IEventBus {
148
addEventListener: IAddListener
159
removeEventListener: IRemoveListener
1610
dispatch: IDispatch
1711
}
1812

19-
const EventBus: IEventBus = require('eventbusjs')
13+
import * as EventBusAny from 'eventbusjs'
14+
const EventBus: IEventBus = EventBusAny
2015
export { EventBus }

types/event-bus.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module 'eventbusjs'

0 commit comments

Comments
 (0)