Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AtomConstructorOptions<S>

Optional paramaters accepted by Atom.of

Type parameters

  • S

    the type of the Atom's inner state

Hierarchy

  • AtomConstructorOptions

Index

Methods

Methods

Optional validator

  • Validates the next state of an Atom during Atom.of, swap, and set. It should either return a boolean or throw an error. If it returns false, then an Error is thrown and the new state is not committed.

    default

    () => true

    Parameters

    Returns boolean