(node: ReactiveNode)
| 337 | * Propagate a dirty notification to live consumers of this producer. |
| 338 | */ |
| 339 | export function producerNotifyConsumers(node: ReactiveNode): void { |
| 340 | if (node.consumers === undefined) { |
| 341 | return; |
| 342 | } |
| 343 | |
| 344 | // Prevent signal reads when we're updating the graph |
| 345 | const prev = inNotificationPhase; |
| 346 | inNotificationPhase = true; |
| 347 | try { |
| 348 | for ( |
| 349 | let link: ReactiveLink | undefined = node.consumers; |
| 350 | link !== undefined; |
| 351 | link = link.nextConsumer |
| 352 | ) { |
| 353 | const consumer = link.consumer; |
| 354 | if (!consumer.dirty) { |
| 355 | consumerMarkDirty(consumer); |
| 356 | } |
| 357 | } |
| 358 | } finally { |
| 359 | inNotificationPhase = prev; |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates, |
no test coverage detected