Cell
TThe type of value contained in the cell.
Constructor Function
function Cell(value, options?): Cell;The Cell API is the fundamental storage building block of Starbeam.
valueTThe initial value of the cell.
options.description?stringA description of the cell.
optionaloptions.equals?(a: T, b: T) => booleanA function that returns true if the values are equal.
optionalreturnsCellA cell with the given initial value.
Properties
current
current: T;The current value of the cell.
bolt Methods
update
update(updater): boolean;updater(prev: T) => TA function that takes the previous value of the cell and returns the new value.
returnsbooleantrueif the value changed,falseotherwise.
set
set(value): boolean;valueTThe new value of the cell.
returnsbooleantrueif the value changed,falseotherwise.
freezeoptimization
freeze(): void;The freeze method prevents the cell from updating. This allows for Starbeam’s internals to avoid checking if the cell has changed when it’s used in a formula.