API Reference
nanoAtom()
Creates a nano atom.
Import
import { nanoAtom } from "@graphrefly/ts/adapters";
Signature
function nanoAtom(
node: Node<T> | WritableNode<T>,
opts: SubscribeValuesOptions<T> | WritableStoreOptions<T> = {},
): NanoAtom<T> | WritableNanoAtom<T>
Parameters
| Parameter | Type | Description |
|---|---|---|
node | Node<T> | WritableNode<T> | node value used by the helper. |
opts | SubscribeValuesOptions<T> | WritableStoreOptions<T> | Options that configure the helper. |
Returns
The nano atom result.
Example
import { nanoAtom } from "@graphrefly/ts/adapters";
Source
packages/ts/src/adapters/store.ts