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

ReadonlyAtom.md

58 lines947 Bytes

1---
2id: ReadonlyAtom
3title: ReadonlyAtom
4---
5​
6Defined in: node\_modules/.pnpm/@tanstack+store@0.11.0/node\_modules/@tanstack/store/dist/types.d.ts:49
7​
8An atom that is read-only and cannot be set.
9​
10## Example
11​
12```ts
13const atom = createAtom(() => 42);
14// @ts-expect-error - Cannot set a readonly atom
15atom.set(43);
16```
17​
18## Extends
19​
20- [`BaseAtom`](BaseAtom.md)\<`T`\>
21​
22## Type Parameters
23​
24### T
25​
26`T`
27​
28## Properties
29​
30### get
31​
32```ts
33get: () => T;
34```
35​
36Defined in: node\_modules/.pnpm/@tanstack+store@0.11.0/node\_modules/@tanstack/store/dist/types.d.ts:20
37​
38#### Returns
39​
40`T`
41​
42#### Inherited from
43​
44[`BaseAtom`](BaseAtom.md).[`get`](BaseAtom.md#get)
45​
46***
47​
48### subscribe
49​
50```ts
51subscribe: (observer) => Subscription & (next, error?, complete?) => Subscription;
52```
53​
54Defined in: node\_modules/.pnpm/@tanstack+store@0.11.0/node\_modules/@tanstack/store/dist/types.d.ts:17
55​
56#### Inherited from
57​
58[`BaseAtom`](BaseAtom.md).[`subscribe`](BaseAtom.md#subscribe)