mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
12 lines
455 B
TypeScript
12 lines
455 B
TypeScript
import { EventDispatcher as EventDispatcherClass } from 'event-dispatch';
|
|
import { Container } from 'typedi';
|
|
|
|
export function EventDispatcher() {
|
|
return (object: any, propertyName: string, index?: number): void => {
|
|
const eventDispatcher = new EventDispatcherClass();
|
|
Container.registerHandler({ object, propertyName, index, value: () => eventDispatcher });
|
|
};
|
|
}
|
|
|
|
export { EventDispatcher as EventDispatcherInterface } from 'event-dispatch';
|