angular/goldens/public-api/core/primitives
Rocky Meza 219462fe0f refactor(core): Split consumerBefore/AfterComputation (#62549)
This makes it possible to batch effects, where we can "reopen" consumers
during initial render and then finalize them after we are finally done
adding all the effects to a batch:

```
function createBatch() {
  const effect = // ... create effect node
  resetConsumerBeforeComputation(effect);
  return effect;
}

// pseudo-code
function appendEffect(effectBatch, updater) {
  if (value is a signal) {
    const prevConsumer = setActiveConsumer(effectBatch.node);
    const output = value();
    setActiveConsumer(prevConsumer);
    effectBatch.push({ signal, updater });
    return output;
  }
}

function finalizeBatch(effectBatch) {
  if (effectBatch.length > 0) {
    finalizeConsumerAfterComputation(effectBatch.node);
  }
}

const effectBatch = createBatchEffectNode();
appendEffect(signal1, (newValue) => /* something */);
appendEffect(signal2, (newValue) => /* something different */);
finalizeBatch(effectBatch);
```

PR Close #62549
2025-09-11 15:47:34 +00:00
..
di refactor(core): Make it so that injecting with just a token guarantees an instance of the type provided. (#62338) 2025-06-30 12:06:02 +00:00
event-dispatch refactor(core): updates to golden files (#60227) 2025-03-25 10:58:00 -07:00
signals refactor(core): Split consumerBefore/AfterComputation (#62549) 2025-09-11 15:47:34 +00:00