Freeze
Stores and holds a value until explicitly updated.
This node stores a value and holds it until it is updated. It acts like a memory cell.
This node has two main operations:
- Initialize: Triggering the
execinput port reads the value fromInit, stores it, and makes it available on thevalueoutput port. It then triggers theexecoutput port to continue the execution flow. - Update: Triggering the
Updateinput port reads the value fromReplace, updates the stored value, and makes the new value available on thevalueoutput port. This operation does not trigger theexecoutput port.
Example Use Case#
This is useful for accumulating values within a loop. For instance, you could use it with an Array Add node to build an array iteratively. The Freeze node would hold the array being built, and on each loop iteration, the Update input would be triggered to store the newly appended array.
Inputs#
| Port | Description |
|---|---|
Stores the value from the Init input. |
|
| The initial value to store. | |
| The new value to replace the stored one. | |
Updates the stored value using the Replace input. |
Outputs#
| Port | Description |
|---|---|
| Continues execution after the value is stored. | |
| The currently stored value. |
ID: core/freeze@v1