What I have
I am trying to adapt a web designed library to react native, this implies that certain things must be replaced like the use of custom events, I want to implement this behaviour, create and dispatch/trigger custom events in RN.
I have reviewed some answers to similar questions, but there are some options to simulate custom events that are no longer works by the new react-native versions, since React Native doesn’t include the Node Standard Library.
What I want
this is a piece of code in which custom events are implemented and captured, this is what I want to simulate in RN.
const authEvent = new Event('auth');
// Listen for the event.
window.addEventListener('auth', function (e) { /* ... */ }, false);
// Dispatch the event.
el.dispatchEvent(authEvent);