File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1742,11 +1742,11 @@ describe('BaseClient', () => {
1742
1742
traceId : '86f39e84263a4de99c326acab3bfe3bd' ,
1743
1743
} as Transaction ;
1744
1744
1745
- client . on ( 'startTransaction' , ( transaction : Transaction ) => {
1745
+ client ? .on ( 'startTransaction' , ( transaction : Transaction ) => {
1746
1746
expect ( transaction ) . toEqual ( mockTransaction ) ;
1747
1747
} ) ;
1748
1748
1749
- client . emit ( 'startTransaction' , mockTransaction ) ;
1749
+ client ? .emit ( 'startTransaction' , mockTransaction ) ;
1750
1750
} ) ;
1751
1751
} ) ;
1752
1752
} ) ;
Original file line number Diff line number Diff line change @@ -150,26 +150,27 @@ export interface Client<O extends ClientOptions = ClientOptions> {
150
150
recordDroppedEvent ( reason : EventDropReason , dataCategory : DataCategory , event ?: Event ) : void ;
151
151
152
152
// HOOKS
153
+ // TODO(v8): Make the hooks non-optional.
153
154
154
155
/**
155
156
* Register a callback for transaction start and finish.
156
157
*/
157
- on ( hook : TransactionHookName , callback : TransactionHookCallback ) : void ;
158
+ on ? ( hook : TransactionHookName , callback : TransactionHookCallback ) : void ;
158
159
159
160
/**
160
161
* Register a callback for envelope creation and sending.
161
162
*/
162
- on ( hook : EnvelopeHookName , callback : EnvelopeHookCallback ) : void ;
163
+ on ? ( hook : EnvelopeHookName , callback : EnvelopeHookCallback ) : void ;
163
164
164
165
/**
165
166
* Fire a hook event for transaction start and finish. Expects to be given a transaction as the
166
167
* second argument.
167
168
*/
168
- emit ( hook : TransactionHookName , ...params : Parameters < TransactionHookCallback > ) : void ;
169
+ emit ? ( hook : TransactionHookName , ...params : Parameters < TransactionHookCallback > ) : void ;
169
170
170
171
/*
171
172
* Fire a hook event for envelope creation and sending. Expects to be given an envelope as the
172
173
* second argument.
173
174
*/
174
- emit ( hook : EnvelopeHookName , ...params : Parameters < EnvelopeHookCallback > ) : void ;
175
+ emit ? ( hook : EnvelopeHookName , ...params : Parameters < EnvelopeHookCallback > ) : void ;
175
176
}
You can’t perform that action at this time.
0 commit comments