Skip to main content

errorSelector(message)

A selector which always throws the provided error

function errorSelector(message: string): RecoilValueReadOnly

Example​

const myAtom = atom({
key: 'My Atom',
default: errorSelector('Attempt to use Atom before initialization'),
});