react-unity-webgl
Advanced tools
Comparing version 9.2.0 to 9.2.1
@@ -33,5 +33,9 @@ "use strict"; | ||
// Loops through all of the mounted event systems and dispatches the event. | ||
return mountedEventDispatchers.forEach(function (dispatchEvent) { | ||
return dispatchEvent.apply(void 0, __spreadArray([eventName], parameters, false)); | ||
// In case there are multiple event systems, the return value origin is | ||
// undefined. | ||
var returnValue = undefined; | ||
mountedEventDispatchers.forEach(function (dispatchEvent) { | ||
returnValue = dispatchEvent.apply(void 0, __spreadArray([eventName], parameters, false)); | ||
}); | ||
return returnValue; | ||
}; | ||
@@ -105,3 +109,3 @@ if (is_browser_environment_1.isBrowserEnvironment === true) { | ||
// The event listener will be invoked with the parameters. | ||
eventListener.callback.apply(eventListener, parameters); | ||
return eventListener.callback.apply(eventListener, parameters); | ||
}, [eventListeners]); | ||
@@ -108,0 +112,0 @@ // Effect ensures that the dispatch event function is available to the |
@@ -12,5 +12,5 @@ /** | ||
*/ | ||
callback: (...parameters: ReactUnityEventParameterType[]) => void; | ||
callback: (...parameters: ReactUnityEventParameterType[]) => ReactUnityEventParameterType; | ||
} | ||
export type { IEventListener }; | ||
//# sourceMappingURL=event-listener.d.ts.map |
@@ -10,3 +10,3 @@ /** | ||
*/ | ||
readonly addEventListener: (eventName: string, callback: (...parameters: ReactUnityEventParameterType[]) => void) => void; | ||
readonly addEventListener: (eventName: string, callback: (...parameters: ReactUnityEventParameterType[]) => ReactUnityEventParameterType) => void; | ||
/** | ||
@@ -17,5 +17,5 @@ * Removes an event listener for external React Unity events. | ||
*/ | ||
readonly removeEventListener: (eventName: string, callback: (...parameters: ReactUnityEventParameterType[]) => void) => void; | ||
readonly removeEventListener: (eventName: string, callback: (...parameters: ReactUnityEventParameterType[]) => ReactUnityEventParameterType) => void; | ||
} | ||
export type { IEventSystemHook }; | ||
//# sourceMappingURL=event-system-hook.d.ts.map |
{ | ||
"name": "react-unity-webgl", | ||
"version": "9.2.0", | ||
"version": "9.2.1", | ||
"description": "React Unity WebGL provides a modern solution for embedding Unity WebGL builds in your React Application while providing advanced APIs for two way communication and interaction between Unity and React.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
87510
1506