Skip to content

Commit 06c5ef3

Browse files
committed
Simplify example code in comment and use more consistent naming
1 parent d1f604e commit 06c5ef3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/error-reporting-service/src/error-reporting-service.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,25 @@ type ErrorReportingServiceOptions = {
9595
* import { ErrorReportingService } from '@metamask/error-reporting-service';
9696
* import { ExampleController } from './example-controller';
9797
*
98-
* type AllActions = MessengerActions<ErrorReportingServiceMessenger>;
99-
*
100-
* type AllEvents = MessengerEvents<ErrorReportingServiceMessenger>;
101-
*
102-
* type RootMessenger = Messenger<'Root', AllActions, AllEvents>;
98+
* type RootMessenger = Messenger<
99+
* 'Root',
100+
* MessengerActions<ErrorReportingServiceMessenger>,
101+
* MessengerEvents<ErrorReportingServiceMessenger>
102+
* >;
103103
*
104-
* // Create a global messenger.
105-
* const globalMessenger = new Messenger();
104+
* // Create a root messenger.
105+
* const rootMessenger = new Messenger();
106106
*
107107
* // Register handler for the `ErrorReportingService:captureException`
108-
* // action in the global messenger.
108+
* // action in the root messenger.
109109
* const errorReportingServiceMessenger = new Messenger<
110110
* 'ErrorReportingService',
111111
* MessengerActions<ErrorReportingServiceMessenger>,
112112
* MessengerEvents<ErrorReportingServiceMessenger>,
113113
* RootMessenger
114114
* >({
115115
* namespace: 'ErrorReportingService',
116-
* parent: globalMessenger,
116+
* parent: rootMessenger,
117117
* });
118118
* const errorReportingService = new ErrorReportingService({
119119
* messenger: errorReportingServiceMessenger,
@@ -127,9 +127,9 @@ type ErrorReportingServiceOptions = {
127127
* RootMessenger
128128
* >({
129129
* namespace: 'ExampleController',
130-
* parent: globalMessenger,
130+
* parent: rootMessenger,
131131
* });
132-
* globalMessenger.delegate({
132+
* rootMessenger.delegate({
133133
* messenger: exampleControllerMessenger,
134134
* actions: ['ErrorReportingService:captureException'],
135135
* });

0 commit comments

Comments
 (0)