(injector: Injector)
| 174 | * @throws If the injector is an environment injector. |
| 175 | */ |
| 176 | export function getSignalGraph(injector: Injector): DebugSignalGraph { |
| 177 | let templateConsumer: ReactiveLViewConsumer | null = null; |
| 178 | |
| 179 | if (!(injector instanceof NodeInjector) && !(injector instanceof R3Injector)) { |
| 180 | return throwError('getSignalGraph must be called with a NodeInjector or R3Injector'); |
| 181 | } |
| 182 | |
| 183 | if (injector instanceof NodeInjector) { |
| 184 | templateConsumer = getTemplateConsumer(injector as NodeInjector); |
| 185 | } |
| 186 | |
| 187 | const nonTemplateEffectNodes = extractEffectsFromInjector(injector); |
| 188 | |
| 189 | const signalNodes = templateConsumer |
| 190 | ? [templateConsumer, ...nonTemplateEffectNodes] |
| 191 | : nonTemplateEffectNodes; |
| 192 | |
| 193 | const signalDependenciesMap = extractSignalNodesAndEdgesFromRoots(signalNodes); |
| 194 | |
| 195 | return getNodesAndEdgesFromSignalMap(signalDependenciesMap); |
| 196 | } |
no test coverage detected