-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
Need docs |
Please update the readme |
@@ -114,7 +133,7 @@ Registers a callback to be called when an event of a type is emitted. Note that | |||
#### `events.emit` | |||
|
|||
```js | |||
events.emit(type, payload, ...args) | |||
events.emit(type, payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like the ctx
should go as an optional arg here? line 141 also needs to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't allow emitting events with ctx as a third argument. It is added by using EventEmitter.of(ctx)
!merge |
for (let index = 0; index < items.length; index++) { | ||
const {type, payload} = items[index]; | ||
emitter.emit(type, payload); | ||
} | ||
ctx.status = 200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter that we are now updating status downstream here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, I think we should set it as early as possible
Fixes #7