You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# ReAtom
1
+
# AtomSphere
2
2
3
3
An atomic state management library for React.
4
4
5
-
ReAtom is very similar to [Jotai](https://jotai.org/) but with a slightly different API. It lets you create `Atoms` and use them in your React components.
5
+
AtomSphere is very similar to [Jotai](https://jotai.org/) but with a slightly different API. It lets you create `Atoms` and use them in your React components.
6
6
7
7
When using atoms, you get a fine-grained reactivity system that only updates the components that depend on the atom that changed
8
8
(as opposed to the traditional React context system, which re-renders all the components under the context when the state changes).
@@ -14,7 +14,7 @@ You can create an atom using the `atom` function, and read it using the `useAtom
14
14
15
15
```tsx
16
16
// Counter.tsx
17
-
import { atom, useAtom } from'reatom';
17
+
import { atom, useAtom } from'atomsphere';
18
18
19
19
const countAtom =atom(0);
20
20
@@ -36,15 +36,15 @@ if you want, you can create your atoms in a separate file and import them in mul
36
36
37
37
```ts
38
38
// atoms.ts
39
-
import { atom } from'reatom';
39
+
import { atom } from'atomsphere';
40
40
41
41
exportconst countAtom =atom(0);
42
42
exportconst nameAtom =atom('John Doe');
43
43
```
44
44
45
45
```tsx
46
46
// Counter.tsx
47
-
import { useAtom } from'reatom';
47
+
import { useAtom } from'atomsphere';
48
48
import { countAtom } from'./atoms';
49
49
50
50
function Counter() {
@@ -61,7 +61,7 @@ function Counter() {
61
61
62
62
```tsx
63
63
// Name.tsx
64
-
import { useAtom } from'reatom';
64
+
import { useAtom } from'atomsphere';
65
65
import { nameAtom } from'./atoms';
66
66
67
67
function Name() {
@@ -76,14 +76,14 @@ function Name() {
76
76
}
77
77
```
78
78
79
-
ReAtom also supports derived atoms, which are atoms that depend on other atoms.
79
+
AtomSphere also supports derived atoms, which are atoms that depend on other atoms.
80
80
81
81
In order to create a derived atom, instead of passing an initial value to the `atom` function, you pass a function that calculates the value of the atom.
82
82
You'll receive a `get` function as an argument that will allow you to get the value of other atoms:
0 commit comments