Interface: AtomOptions<T>
API / @xmachines/play-atom / AtomOptions
Defined in: play-atom/src/types.ts:147
The options of createAtom
compare decides if the value changed. The default is Object.is. An atom that
compares equal notifies no observer.
Example
import { createAtom } from "@xmachines/play-atom";
const point = createAtom( { x: 0, y: 0 }, { compare: (previous, next) => previous.x === next.x && previous.y === next.y },);Type Parameters
| Type Parameter |
|---|
T |
Properties
| Property | Type | Defined in |
|---|---|---|
compare? | (previous, next) => boolean | play-atom/src/types.ts:148 |