fixed memory leak

This commit is contained in:
Daniel Shleifman
2021-05-27 18:47:39 +03:00
parent bd492b4bf8
commit 981f668da5
2 changed files with 6 additions and 5 deletions

View File

@@ -36,7 +36,7 @@ export const useUpdateCache = hash => {
return cache
}
export const useCreateCacheMap = (cache, callback) => {
export const useCreateCacheMap = cache => {
const [cacheMap, setCacheMap] = useState([])
useEffect(() => {
@@ -67,8 +67,7 @@ export const useCreateCacheMap = (cache, callback) => {
}
setCacheMap(map)
callback && callback()
}, [cache, callback])
}, [cache])
return cacheMap
}