mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: Re-compute the given items cost job.
feat: Optimize the architecture.
This commit is contained in:
16
server/src/decorators/eventDispatcher.ts
Normal file
16
server/src/decorators/eventDispatcher.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Originally taken from 'w3tecch/express-typescript-boilerplate'
|
||||
* Credits to the author
|
||||
*/
|
||||
|
||||
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';
|
||||
Reference in New Issue
Block a user