RAN3D / spray-wrtc

Adaptive random peer sampling protocol running on top of WebRTC.
https://ran3d.github.io/spray-wrtc/
MIT License
39 stars 7 forks source link

Emit spray id during the join event #17

Closed folkvir closed 5 years ago

folkvir commented 7 years ago

Hi ! It would be very greatful to emit the id when you emit the join event.

Here is the code to change (line 101/102, spray.js) :

callbacks.onReady = function(id){
  onReadyFunction && onReadyFunction(id);
  // #D emit a join event
  self.emit('join');
};

to

self.emit('join', id);

If you can do it with a NPM release it would be great !

folkvir commented 5 years ago

No longer needed with the new version coming.