-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ref(utils): Introduce getEnvelopeType helper #4751
Conversation
Simplify new transport send by grabbing the envelope category from the envelope instead of passing it in explicitly.
size-limit report
|
packages/core/src/transports/base.ts
Outdated
@@ -104,7 +106,8 @@ export function createTransport( | |||
|
|||
const flush = (timeout?: number): PromiseLike<boolean> => buffer.drain(timeout); | |||
|
|||
function send(envelope: Envelope, category: TransportCategory): PromiseLike<TransportResponse> { | |||
function send(envelope: Envelope): PromiseLike<TransportResponse> { | |||
const category = getEnvelopeType(envelope) as TransportCategory; |
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.
Naive question because I'm not too familiar with envelopes yet: Would it make sense to change the return type of getEnvelopeType
to be more strict instead of casting 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.
Changed to make this more clear!
Simplify new transport send by grabbing the envelope category from the
envelope instead of passing it in explicitly.