UNINITIALIZED
See source codeA special symbol used to indicate that a computed signal has not been initialized yet.
This is passed as the previousValue
parameter to a computed signal function on its first run.
UNINITIALIZED: unique symbol
Example
const count = atom('count', 0)
const double = computed('double', (prevValue) => {
if (isUninitialized(prevValue)) {
console.log('First computation!')
}
return count.get() * 2
})
Prev
RESET_VALUENext
WithDiff