engine
engine copied to clipboard
Event emitters with remote access cause an error if their subscribe method gets more than one argument
If I use a multi event emitter with allowRemoteAccess
and I pass more than one argument to the subscribe method I get this error:
Failed to execute 'postMessage' on 'Worker': function () { [native code] } could not be cloned
.
(specifically, the first argument is string & the second is a function).
It seems that callMethod
calls addOrRemoveListener
only if there is only one argument and it's a function.
Refs: https://github.com/wixplosives/engine/blob/efd9586a0fd8aac72fed5f71d817b048a75a87dc/packages/core/src/com/communication.ts#L720 https://github.com/wixplosives/engine/blob/efd9586a0fd8aac72fed5f71d817b048a75a87dc/packages/core/src/com/communication.ts#L199