Skip to content

Commit

Permalink
Remove unnecessary assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbaroni committed Dec 20, 2024
1 parent 5d9d5c4 commit 61e97f4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/state/internal/createQueryStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,9 @@ export function createQueryStore<

const createState: StateCreator<S, [], [['zustand/subscribeWithSelector', never]]> = (set, get, api) => {
const pruneCache = (state: S): S => {
const now = Date.now();
const newCache: Record<string, CacheEntry<TData>> = {};
Object.entries(state.queryCache).forEach(([key, entry]) => {
if (entry && now - entry.lastFetchedAt <= cacheTime) {
if (entry && Date.now() - entry.lastFetchedAt <= cacheTime) {
newCache[key] = entry;
}
});
Expand Down

0 comments on commit 61e97f4

Please sign in to comment.