Gather

Reactive.Emit sends a value to the Reactive.Gather of the same name. The emits come first. The gather comes after them, in the same function, at the same level or further out. The gather has no block. Its result is one value, and that value carries a read lock and a write lock like any other.

Reactive.Emit("components", component);

const components = Reactive.Gather(Collection.Array.Of(Ui.Component), "components");
Emit a component, then gather the components of that name.

What a gather is for

Emit and gather build a value in the running code. Ui.Render gathers components and returns that array. A handler sets a context with Reactive.With, or gathers some other way, and then works on the gathered values itself. A driver is not given that array. A driver is entered by a context call.

Every emission has a stable id. That id is the key of the element in the gathered array. The program does not choose the id, and it cannot pair it with the id of a value that entered an Each.

An emit inside a reverse does not feed a gather outside that reverse. A read lock on a value that is emitted locks the gather result, because the lock spreads to the array that contains it. When an If or an Each is skipped because its condition or its array is read-locked, the gather of what those arms would have emitted is read-locked as well.