-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal for new syntax #21
Comments
well, I often make I guess this is okay for string events who's name does not have a special meaning - like 'newListener' or 'error' another event that streams use, etc. |
in line 38: var stream = createStream(id, data[1].meta, data[1].opts)
md.emit(stream.meta, stream) |
no, I don't understand why it broke, show me the broken code, enough to run. it may be: if you don't pass have a connection listener, it calls something like that... |
It breaks when you have var stream = createStream(id, data[1].meta, data[1].opts)
md.emit(stream.meta, stream)
md.emit('connection', stream) or var stream = createStream(id, data[1].meta, data[1].opts)
md.emit(stream.meta, stream)
md.emit('connection', createStream(id, data[1].meta, data[1].opts)) In both cases I can't get a connection |
With the additional meta: mdm.on('foobar', function (stream, meta) {}) That's more opinionated but imo nicer. I started needing objects as meta too, so that'd be necessary also. I'll upload my modifications and a test later... |
Well, you can build this ontop of mux-demux if you want... But I'm reluctant to change mux-demux at this point, Intending to rewrite it. |
take a look at https://github.com/AndreasMadsen/nspoint (Note: I couldn't actually get it to work.) |
@kumavis sure, well you could easily build that with a lib on top of mux-demux. |
Instead of the large conditionals in the connection handler, like
It would be nice to have this syntax:
This way we have shorter code and named streams.
I tried implementing it but it only worked when I let it stop emitting 'connection'-Events.
What do you think?
The text was updated successfully, but these errors were encountered: