mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 11:49:02 +08:00
fix: Allow emit
to be accessed anywhere (#3848)
This commit is contained in:
parent
32ed87b409
commit
ec1752374e
@ -22,7 +22,7 @@ export class EventEmitter<T extends Record<string, any>> {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
protected emit<EventName extends StringKeyOf<T>>(event: EventName, ...args: CallbackType<T, EventName>): this {
|
public emit<EventName extends StringKeyOf<T>>(event: EventName, ...args: CallbackType<T, EventName>): this {
|
||||||
const callbacks = this.callbacks[event]
|
const callbacks = this.callbacks[event]
|
||||||
|
|
||||||
if (callbacks) {
|
if (callbacks) {
|
||||||
@ -46,7 +46,7 @@ export class EventEmitter<T extends Record<string, any>> {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
protected removeAllListeners(): void {
|
public removeAllListeners(): void {
|
||||||
this.callbacks = {}
|
this.callbacks = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user