Skip to content


Subversion checkout URL

You can clone with
Download ZIP


API is unclear #8

nickdaugherty opened this Issue · 3 comments

2 participants


From the documentation, it's difficult to determine exactly how to use this plugin.

The docs mention passing the stream to reconnect(), but also passing opts and onConnect - how is it actually used?

A more intuitive and standard API would be:

reconnect(stream, options);

Thanks for posting a documentation issue!

reconnent needs know how to create a new connection if the current connection ends,

so the api is

reconnect(function (stream) {
  //your code here
}, options)

reconnect(stream, options), wouldn't work, because reconnect wouldn't know what sort of stream you have.

what sort of connection are you trying to reconnect?


Makes is reconnect (opts, onConnect) (from the docs) a valid function signature, or is that backwards?


oh, right - I gave the options in the other order in my example there - that should have been the other way around,
or you can leave options out and get the defaults (which is what I normally do)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.