jshttp/on-headers

It's would be better if support multiple listeners.

fanchangyong opened this issue · 2 comments

I want to do multiple things before headers be sent,but i see the code,it only stores one listener,so later added listeners will replace pre-added listener.It would be better to make listeners be an array,so it supports multiple listeners.

Sorry,It's not a problem.I tested it,it worked with multiple listeners.
Because it's used a linked-list-like style listeners chain.

Ah, yes, you just call the function each time to add a new one and it'll just chain them all (and they fire in the reverse order they were added).