Usage case:
request
fired. This allows to capture request state and deserialize access tokens, session from cookies, etc.before-response
fired with request and response refs, to serialize security claims into cookies if necessary.request
event handlers like[interceptSession, rebuildClaims]
while on the before-response
the event handlers must be run in opposite order:
[serializeClaims, packSession]
But with current API I can not directly express this with Emittery
.
So, I would like to see either
prepend<TName, TData>(eventName:TName, data:TData);
in an Emittery instance, or some flag like:
emitSerial<TName, TData>(name:TName, data:TData, reversed?:boolean):Promise<void>;
in my case I can wrap event handlers registration and postpone actual on
calls, until the building of web application will be completed.
But async match of EventEmitter.prependListener
and EventEmitter.prependOnceListener
may be helpful in some other cases when delayed listeners construction is not possible.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too