You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this should be doing addEventListener and removeEventListener to align with the EventTarget interface, which MessagePort should extend. I think on and off are more strictly related to Node's implementation and are usually just aliases of add/remove event listener.
Example of additional work needed when integrating rpc-reflector is somewhat describe here, where the channel in question didn't have on and off methods and so a custom class had to be created to emulate the checked interface (digidem/comapeo-mobile#8):
separate implementations of MessagePortLike. this is because the nodejs-mobile channel extends different behaving classes based on the environment (Node's EventEmitter in the nodejs-mobile process but React Native's EventEmitter in the React Native runtime). Due to the different APIs and behaviors between the two, creating a shared implementation is not trivial and more overhead than necessary.
The text was updated successfully, but these errors were encountered:
turns out node's event emitter doesn't implement addEventListener and removeEventListener 🤦♂️ Still, maybe at least check for addListener and removeListener
Looking at this check:
rpc-reflector/lib/is-message-port-like.js
Lines 19 to 21 in 3cbcc1d
I think this should be doing
addEventListener
andremoveEventListener
to align with theEventTarget
interface, which MessagePort should extend. I thinkon
andoff
are more strictly related to Node's implementation and are usually just aliases of add/remove event listener.Example of additional work needed when integrating rpc-reflector is somewhat describe here, where the channel in question didn't have
on
andoff
methods and so a custom class had to be created to emulate the checked interface (digidem/comapeo-mobile#8):The text was updated successfully, but these errors were encountered: