Commit 94d55d8
authored
feat: refactor notification controller initialisation (#5504)
## Explanation
Separates out the controller constructor and initialisation. This makes
it easier to integrate with the Modular Initialisation approach in
extension and mobile.
**BREAKING** it would now require the controller to explicitly call init
after being constructed to be correctly setup. E.g.
```
const notificationServicesController = ...
// This needs to be done
notificationServicesController.init()
```
## References
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?
For example:
* Fixes #12345
* Related to #67890
-->
## Changelog
<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.
(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)
Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).
If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.
Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->
### `@metamask/notification-services-controller`
- **REMOVED**: BREAKING - refactored out the
`NotificationServicesController` constructor initialisation methods. You
must explicitly call the `.init()` method to initialise controller
- **ADDED**: `init` method to initialise
`NotificationServicesController`
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes1 parent 8bf4c2a commit 94d55d8
File tree
2 files changed
+32
-22
lines changed- packages/notification-services-controller/src/NotificationServicesController
2 files changed
+32
-22
lines changedLines changed: 30 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 72 | | |
93 | 73 | | |
94 | 74 | | |
| |||
108 | 88 | | |
109 | 89 | | |
110 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| |||
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
202 | | - | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| 212 | + | |
| 213 | + | |
208 | 214 | | |
209 | 215 | | |
210 | 216 | | |
| |||
287 | 293 | | |
288 | 294 | | |
289 | 295 | | |
290 | | - | |
| 296 | + | |
291 | 297 | | |
292 | 298 | | |
293 | 299 | | |
| |||
296 | 302 | | |
297 | 303 | | |
298 | 304 | | |
| 305 | + | |
| 306 | + | |
299 | 307 | | |
300 | 308 | | |
301 | 309 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| 548 | + | |
548 | 549 | | |
| 550 | + | |
549 | 551 | | |
550 | 552 | | |
551 | 553 | | |
| |||
0 commit comments