substream icon indicating copy to clipboard operation
substream copied to clipboard

add event-emitter support across transport

Open tjmehta opened this issue 8 years ago • 1 comments

Love substream and primus thanks for the modules!

This is a working attempt of adding event-emitter support to substreams (so that they emit events across the wire)

I am not super knowledgeable w/ substream, so please let me know if there are any side effects. Currently I am ignoring data and end events because they are already handled by substream.

I am also, unsure how you would like error events to be emitted across the wire. I was thinking of using http://npmrepo.com/error-to-json to convert the error to json before sending it over the wire, and then parsing as an error on the receiving end.

Let me know what you think.

Thanks!

tjmehta avatar Jul 01 '16 19:07 tjmehta