1 import { useContext } from 'react';
3 import type { Cache } from '@proton/shared/lib/helpers/cache';
5 import Context from '../containers/cache/cacheContext';
7 const useCache = <K = string, V = any>() => {
8 const cache = useContext(Context);
11 throw new Error('Trying to use uninitialized CacheContext');
14 return cache as Cache<K, V>;
17 export default useCache;