Viewing File: /home/maglabs/marco/wp-content/plugins/extendify/src/Launch/hooks/useCache.js

import { useSWRConfig } from 'swr';

export const useCache = () => {
	const { cache } = useSWRConfig();
	return (keyToMatch) => cache.get(findKey(keyToMatch, cache));
};
const findKey = (partial, map) => {
	for (const key of map.keys()) {
		if (key.match(partial)) return key;
	}
};
Back to Directory File Manager