RESET_VALUE
See source codeA unique symbol used to indicate that a signal's value should be reset or that there is insufficient history to compute diffs between epochs.
This value is returned by Signal.getDiffSince when the requested epoch is too far in the past and the diff sequence cannot be reconstructed.
RESET_VALUE: unique symbol
Example
import { atom, getGlobalEpoch, RESET_VALUE } from '@tldraw/state'
const count = atom('count', 0, { historyLength: 3 })
const oldEpoch = getGlobalEpoch()
// Make many changes that exceed history length
count.set(1)
count.set(2)
count.set(3)
count.set(4)
const diffs = count.getDiffSince(oldEpoch)
if (diffs === RESET_VALUE) {
console.log('Too many changes, need to reset state')
}
Prev
EMPTY_ARRAYNext
UNINITIALIZED