mirror of
https://github.com/revoltchat/revite.git
synced 2025-02-24 09:10:57 -05:00
19 lines
577 B
TypeScript
19 lines
577 B
TypeScript
|
import EventEmitter from "eventemitter3";
|
||
|
export const InternalEvent = new EventEmitter();
|
||
|
|
||
|
export function internalSubscribe(ns: string, event: string, fn: (...args: any[]) => void) {
|
||
|
InternalEvent.addListener(ns + '/' + event, fn);
|
||
|
return () => InternalEvent.removeListener(ns + '/' + event, fn);
|
||
|
}
|
||
|
|
||
|
export function internalEmit(ns: string, event: string, ...args: any[]) {
|
||
|
InternalEvent.emit(ns + '/' + event, ...args);
|
||
|
}
|
||
|
|
||
|
// Event structure: namespace/event
|
||
|
|
||
|
/// Event List
|
||
|
// - MessageRenderer/edit_last
|
||
|
// - MessageRenderer/edit_message
|
||
|
// - MessageBox/focus
|