FelixHenninger / lab.js

Online research made easy
https://lab.js.org/
Other
239 stars 107 forks source link

fix: emitter debug logs #240

Open nnakagaki opened 1 week ago

nnakagaki commented 1 week ago

Currently, emitter logs do not properly log the component ID. This is because the ID is passed in to the Emitter constructor when the Component is constructed here. At this point, the Component ID is undefined unless specifically passed. The component's ID that is set later in study prep is not reflected in Emitter.

This fixes the issue by passing in the component reference to the Emitter and accessing the ID through the Component. Also changed the first argument to the required instead of optional to simplify the interface.