The options to configure an atom, passed into the atom function.
A method used to compute a diff between the atom's old and new values. If provided, it will not be used unless you also specify AtomOptions.historyLength.
Defined in: signia/src/Atom.ts:27
The maximum number of diffs to keep in the history buffer.
If you don't need to compute diffs, or if you will supply diffs manually via Atom.set, you can leave this as
undefined and no history buffer will be created.
If you expect the value to be part of an active effect subscription all the time, and to not change multiple times inside of a single transaction, you can set this to a relatively low number (e.g. 10).
Otherwise, set this to a higher number based on your usage pattern and memory constraints.
Defined in: signia/src/Atom.ts:23
If provided, this will be used to compare the old and new values of the atom to determine if the value has changed.
By default, values are compared using first using strict equality (
Object.is, and finally any
.equals method present in the object's prototype chain.
(a: any, b: any): boolean;
Defined in: signia/src/Atom.ts:35