Skip to content
Source
Sign inSign up
TanStack/store
Open History to see the last commit

createAtom.md

60 lines844 Bytes

1---
2id: createAtom
3title: createAtom
4---
5​
6## Call Signature
7​
8```ts
9function createAtom<T>(getValue, options?): ReadonlyAtom<T>;
10```
11​
12Defined in: [atom.ts:146](https://github.com/TanStack/store/blob/main/packages/store/src/atom.ts#L146)
13​
14### Type Parameters
15​
16#### T
17​
18`T`
19​
20### Parameters
21​
22#### getValue
23​
24(`prev?`) => `T`
25​
26#### options?
27​
28[`AtomOptions`](../interfaces/AtomOptions.md)\<`T`\>
29​
30### Returns
31​
32[`ReadonlyAtom`](../interfaces/ReadonlyAtom.md)\<`T`\>
33​
34## Call Signature
35​
36```ts
37function createAtom<T>(initialValue, options?): Atom<T>;
38```
39​
40Defined in: [atom.ts:150](https://github.com/TanStack/store/blob/main/packages/store/src/atom.ts#L150)
41​
42### Type Parameters
43​
44#### T
45​
46`T`
47​
48### Parameters
49​
50#### initialValue
51​
52`T`
53​
54#### options?
55​
56[`AtomOptions`](../interfaces/AtomOptions.md)\<`T`\>
57​
58### Returns
59​
60[`Atom`](../interfaces/Atom.md)\<`T`\>