We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 026e8f0 commit 936ce0aCopy full SHA for 936ce0a
src/2n8.ts
@@ -98,14 +98,11 @@ export function createStore<Store extends TwoAndEight>(
98
const cache = {} as Store
99
100
const get = <Field extends keyof Store>(field: Field) => {
101
- const storedValue = store[field]
102
- const cachedValue = cache[field]
103
-
104
- if (typeof storedValue === 'function') {
105
- return storedValue
+ if (typeof store[field] === 'function') {
+ return store[field]
106
}
107
108
- if (!isEqual(storedValue, cachedValue)) {
+ if (!isEqual(store[field], cache[field])) {
109
cache[field] = structuredClone(store[field])
110
111
0 commit comments