2
program.addEventListener("GameResult", (event, game, res) => {
    console.log("EVENT: ", event, game, res)
})

Sometimes it registers the event, sometimes it does not. I don't know what the hell is going on.

1 Answer 1

0

Here's a revised example with proper event emission and listener attachment:

// Define the event emitter function
function emitGameResultEvent() {
    // ... Your event emission code here ...
}

// Add the event listener
program.addEventListener("GameResult", (event, game, res) => {
    console.log("EVENT: ", event, game, res);
});

// Emit the event somewhere in your code
emitGameResultEvent();

Make sure that the event emission is happening consistently and that the listener is added before any events are emitted. If you're still facing issues, double-check the event name for any typos.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.