Browse Source

fix(server): Fix a few TS compiler errors

Michael Bromley 7 years ago
parent
commit
e3f3c7c6c4
1 changed files with 3 additions and 3 deletions
  1. 3 3
      server/src/event-bus/event-bus.ts

+ 3 - 3
server/src/event-bus/event-bus.ts

@@ -32,11 +32,11 @@ export class EventBus {
      * to unsubscribe the handler from the event.
      */
     subscribe<T extends VendureEvent>(type: Type<T>, handler: EventHandler<T>): UnsubscribeFn {
-        const handlers = this.subscriberMap.get(type) || [];
+        const handlers = this.subscriberMap.get(type as any) || [];
         if (!handlers.includes(handler)) {
             handlers.push(handler);
         }
-        this.subscriberMap.set(type, handlers);
-        return () => this.subscriberMap.set(type, handlers.filter(h => h !== handler));
+        this.subscriberMap.set(type as any, handlers);
+        return () => this.subscriberMap.set(type as any, handlers.filter(h => h !== handler));
     }
 }