Skip to content

Conversation

@lpinca
Copy link
Member

@lpinca lpinca commented Dec 15, 2015

This adds the primus-emit functionality to the SubStream instance.

I don't like the fact that it uses a trigger method instead of the usual emit, but I tried to override the emit method and it broke the tests.

cc: @3rd-Eden @siddo420

@3rd-Eden
Copy link
Member

The trigger name though.. yuk. It triggers my OCD hard especially because we already have primus-emit that just uses emit for the event emitting. So this introduces a different API for emitting and when you pair substream with primus-emit you end up with really odd code.

@lpinca
Copy link
Member Author

lpinca commented Dec 17, 2015

I totally agree :/

@lpinca
Copy link
Member Author

lpinca commented Dec 17, 2015

Maybe we can remove the trigger method and document that if you want to trigger an even on the substream you can use something like this:

substream._write({ emit: [ eventName, arg ] });

but I don't know if it is any better, it's cumbersome and uses the private _write method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants