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

Atom.md

60 lines973 Bytes

1---
2id: Atom
3title: Atom
4---
5​
6Defined in: [types.ts:42](https://github.com/TanStack/store/blob/main/packages/store/src/types.ts#L42)
7​
8## Extends
9​
10- [`BaseAtom`](BaseAtom.md)\<`T`\>
11​
12## Type Parameters
13​
14### T
15​
16`T`
17​
18## Properties
19​
20### get
21​
22```ts
23get: () => T;
24```
25​
26Defined in: [types.ts:30](https://github.com/TanStack/store/blob/main/packages/store/src/types.ts#L30)
27​
28#### Returns
29​
30`T`
31​
32#### Inherited from
33​
34[`BaseAtom`](BaseAtom.md).[`get`](BaseAtom.md#get)
35​
36***
37​
38### set
39​
40```ts
41set: (fn) => void & (value) => void;
42```
43​
44Defined in: [types.ts:44](https://github.com/TanStack/store/blob/main/packages/store/src/types.ts#L44)
45​
46Sets the value of the atom using a function.
47​
48***
49​
50### subscribe
51​
52```ts
53subscribe: (observer) => Subscription & (next, error?, complete?) => Subscription;
54```
55​
56Defined in: [types.ts:21](https://github.com/TanStack/store/blob/main/packages/store/src/types.ts#L21)
57​
58#### Inherited from
59​
60[`BaseAtom`](BaseAtom.md).[`subscribe`](BaseAtom.md#subscribe)