Constructors
constructor
- new PubSub<Events>(): PubSub<Events>
Type Parameters
Returns PubSub<Events>
Methods
emit
- emit<Key>(event: number | Key, ...data: Parameters<Events[Key]>): void
Type Parameters
Key extends string | number | symbol
Parameters
event: number | Key
Rest ...data: Parameters<Events[Key]>
Returns void
off
- off<Key>(event: Key, callback?: Events[keyof Events]): void
Type Parameters
Key extends string | number | symbol
Parameters
event: Key
Optional callback: Events[keyof Events]
Returns void
on
- on<Key>(event: Key, callback: Events[keyof Events]): void
Type Parameters
Key extends string | number | symbol
Parameters
event: Key
callback: Events[keyof Events]
Returns void
发布