question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[3.0.0-beta.15] Events being emitted, but callbacks not firing.

See original GitHub issue

I’m attempting to hook into the ready event using:

import plyr from 'plyr';

const player = new plyr(el, {...});

player.on('ready', e => {...});

With debugging enabled, you can see the event: ready line emitted in the console, but the callback passed to instance.on(...) never fires. There seems to be a bit of a disconnect here.

Any idea why this might be happening?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fridaycommented, Mar 3, 2018

And sorry @gehaktmolen. If you would have made that timeout 0 it would been the same solution.

1reaction
fridaycommented, Mar 3, 2018

👍 I’m not sure my terminology is correct, but setTimeout with 0 duration will run the method on the next “tick” (next iteration in the eventloop), so yes. I probably over thought it by assuming ready should work retroactively, like jquery etc.

In retrospect I think your solution is better (less code & more consistent).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event not firing/being caught - javascript - Stack Overflow
I have a class DiscordClient that I would like to emit events because I want other classes to be able to respond to...
Read more >
Event emitter calls listeners immediately, rather than on nextTick
Rather than being "emit my event", the present behavior is actually "execute arbitrary code". That seems like broken behavior, and I know from ......
Read more >
Application API - Sphinx documentation
Return the return values of all callbacks as a list. Do not emit core Sphinx events in extensions! Parameters: event – The name...
Read more >
Events | Node.js v19.3.0 Documentation
All objects that emit events are instances of the EventEmitter class. ... callback are inserted before the listener that is in the process...
Read more >
jQuery 3.0 Beta Released
Despite the 3.0 version number, we anticipate that these releases shouldn't be too much trouble when it comes to upgrading existing code. Yes, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found