Cell
T
The 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.
value
T
The initial value of the cell.
options.description?
string
A description of the cell.
optional
options.equals?
(a: T, b: T) => boolean
A function that returns true if the values are equal.
optional
returns
Cell
A 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) => T
A function that takes the previous value of the cell and returns the new value.
returns
boolean
true
if the value changed,false
otherwise.
set
set(value): boolean;
value
T
The new value of the cell.
returns
boolean
true
if the value changed,false
otherwise.
freeze
optimization
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.