Skip to content

Commit

Permalink
chore: Remove leftover code
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Jan 7, 2025
1 parent 2b80152 commit 9378c1d
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/lib/use-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,6 @@ import { useEffect } from 'preact/hooks';
export const CACHE = new Map();
export const createCacheKey = (fn, deps) => '' + fn + JSON.stringify(deps);

export function prefetchRepl() {
const load = () => Promise.all([
import('../components/code-editor'),
import('../components/controllers/repl/runner')
]).then(([CodeEditor, Runner]) => ({ CodeEditor: CodeEditor.default, Runner: Runner.default }));

const cacheKey = createCacheKey(load, ['repl']);
if (CACHE.has(cacheKey)) return;

setupCacheEntry(load, cacheKey);
}

export function useRepl() {
return useResource(() => Promise.all([
import('../components/code-editor'),
import('../components/controllers/repl/runner')
]).then(([CodeEditor, Runner]) => ({ CodeEditor: CodeEditor.default, Runner: Runner.default })), ['repl']);
}

export function useResource(fn, deps) {
const cacheKey = createCacheKey(fn, deps);

Expand Down

0 comments on commit 9378c1d

Please sign in to comment.