@@ -71,7 +71,7 @@ The **`createAtomStore`** function returns an object (**`AtomStoreApi`**) contai
71
71
` ` ` js
72
72
const store = useElementStore ();
73
73
74
- const element = useValueOfJotaiXStore (' element' );
74
+ const element = useStoreValue (' element' );
75
75
// alternative
76
76
const element = store .useElementValue ();
77
77
// alternative
@@ -84,15 +84,15 @@ The **`createAtomStore`** function returns an object (**`AtomStoreApi`**) contai
84
84
// Approach 1: Memoize the selector yourself
85
85
const toUpperCase = useCallback((element) => element.toUpperCase(), []);
86
86
// Now it will only re-render if the uppercase value changes
87
- const element = useValueOfJotaiXStore (store, 'element', toUpperCase);
87
+ const element = useStoreValue (store, 'element', toUpperCase);
88
88
// alternative
89
89
const element = store.useElementValue(toUpperCase);
90
90
// alternative
91
91
const element = useElementStore().useValue('element', toUpperCase);
92
92
93
93
// Approach 2: Pass an dependency array to prevent re-renders
94
94
const [n, setN] = useState(0); // n may change during re-renders
95
- const numNthCharacter = useValueOfJotaiXStore (store, 'element', (element) => element[n], [n]);
95
+ const numNthCharacter = useStoreValue (store, 'element', (element) => element[n], [n]);
96
96
// alternative
97
97
const numNthCharacter = store.useElementValue((element) => element[n], [n]);
98
98
// alternative
@@ -101,7 +101,7 @@ The **`createAtomStore`** function returns an object (**`AtomStoreApi`**) contai
101
101
- **` useSet ` **: Hooks for setting a state within a component . See [useSetAtom ](https : // jotai.org/docs/core/use-atom#usesetatom).
102
102
` ` ` js
103
103
const store = useElementStore();
104
- const element = useSetOfJotaiXStore (store, 'element');
104
+ const element = useStoreSet (store, 'element');
105
105
// alternative
106
106
const element = store.useSetElement();
107
107
// alternative
@@ -110,7 +110,7 @@ The **`createAtomStore`** function returns an object (**`AtomStoreApi`**) contai
110
110
- **` useState ` **: Hooks for accessing and setting a state within a component , ensuring re -rendering when the state changes. See [useAtom ](https : // jotai.org/docs/core/use-atom).
111
111
` ` ` js
112
112
const store = useElementStore();
113
- const element = useStateOfJotaiXStore (store, 'element');
113
+ const element = useStoreState (store, 'element');
114
114
// alternative
115
115
const element = store.useElementState();
116
116
// alternative
0 commit comments