import { useContext } from 'react';
import Context from '../containers/eventManager/context';

function useEventManager() {
    const eventManager = useContext(Context);

    if (!eventManager) {
        throw new Error('Trying to use uninitialized EventManagerContext');
    }

    return eventManager;
}

export default useEventManager;

import { useContext } from 'react';
import { EventManager } from 'proton-shared/lib/eventManager/eventManager';
import Context from '../containers/eventManager/context';

function useEventManager<EventModel, ListenerResult = void>() {
    const eventManager = useContext(Context);

    if (!eventManager) {
        throw new Error('Trying to use uninitialized EventManagerContext');
    }

    return eventManager as EventManager<EventModel, ListenerResult>;
}

export default useEventManager;

--- 
+++ 
@@ -1,15 +1,14 @@
 import { useContext } from 'react';
-import { EventManager } from 'proton-shared/lib/eventManager/eventManager';
 import Context from '../containers/eventManager/context';
 
-function useEventManager<EventModel, ListenerResult = void>() {
+function useEventManager() {
     const eventManager = useContext(Context);
 
     if (!eventManager) {
         throw new Error('Trying to use uninitialized EventManagerContext');
     }
 
-    return eventManager as EventManager<EventModel, ListenerResult>;
+    return eventManager;
 }
 
 export default useEventManager;
Move event manager type inference to subscribe function
