Method
createSingleton
(
configHandler: ConfigHandler,
ide: IDE,
messenger?: IMessenger<ToCoreProtocol, FromCoreProtocol>,
)
Source from the content-addressed store, hash-verified
| 215 | // Singleton pattern: only one service globally |
| 216 | private static instance?: DocsService; |
| 217 | static createSingleton( |
| 218 | configHandler: ConfigHandler, |
| 219 | ide: IDE, |
| 220 | messenger?: IMessenger<ToCoreProtocol, FromCoreProtocol>, |
| 221 | ) { |
| 222 | const docsService = new DocsService(configHandler, ide, messenger); |
| 223 | DocsService.instance = docsService; |
| 224 | return docsService; |
| 225 | } |
| 226 | |
| 227 | static getSingleton() { |
| 228 | return DocsService.instance; |
Tested by
no test coverage detected