rwaldron / particle-io

Particle/Spark Core/Photon IO Plugin for Johnny-Five
http://johnny-five.io
MIT License
173 stars 31 forks source link

Emit socket error events #78

Closed gsbucks closed 7 years ago

gsbucks commented 7 years ago

Totally up to you whether you want to accept this, but I needed to make some of these changes so I figured I would see if you wanted them.

Reasons for the changes: 1) Net socket errors were never emitted, so if the initial connection failed, an error would be asynchronously thrown with no good way to catch it. 2) The isConnected state variable and the 'connect' event were being triggered regardless of it a connection was actually established. I left the 'connect' event that way just in case it's supposed to mean it's starting to connect 3) Deleted isReady since it didn't appear to be used anywhere

rwaldron commented 7 years ago

Deleted isReady since it didn't appear to be used anywhere

isReady is used by Johnny-Five as part of the required IO-Plugin semantics.