(injector: Injector)
| 275 | * @throws If the injector is an environment injector. |
| 276 | */ |
| 277 | export function getSignalGraph(injector: Injector): DebugSignalGraph { |
| 278 | let templateConsumer: ReactiveLViewConsumer | null = null; |
| 279 | |
| 280 | if (!(injector instanceof NodeInjector) && !(injector instanceof R3Injector)) { |
| 281 | return throwError('getSignalGraph must be called with a NodeInjector or R3Injector'); |
| 282 | } |
| 283 | |
| 284 | if (injector instanceof NodeInjector) { |
| 285 | templateConsumer = getTemplateConsumer(injector as NodeInjector); |
| 286 | } |
| 287 | |
| 288 | const nonTemplateEffectNodes = extractEffectsFromInjector(injector); |
| 289 | |
| 290 | const signalNodes = templateConsumer |
| 291 | ? [templateConsumer, ...nonTemplateEffectNodes] |
| 292 | : nonTemplateEffectNodes; |
| 293 | |
| 294 | const signalDependenciesMap = extractSignalNodesAndEdgesFromRoots(signalNodes); |
| 295 | |
| 296 | return getNodesAndEdgesFromSignalMap(signalDependenciesMap); |
| 297 | } |
| 298 | |
| 299 | /** |
| 300 | * Toggles debug watching for a signal node by its ID. |
no test coverage detected