Skip to content

Commit

Permalink
Update test refs
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Dec 14, 2022
1 parent 26c0862 commit cef1be2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/swc_ecma_minifier/tests/fixture/issues/6636/output.js
@@ -1,8 +1,4 @@
export function memo(getDeps, fn, opts) {
let result, deps = [];
return ()=>{
opts.key && opts.debug && Date.now();
const newDeps = getDeps(), depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index)=>deps[index] !== dep);
return depsChanged && (deps = newDeps, opts.key && opts.debug && Date.now(), result = fn(...newDeps), opts?.onChange?.(result), opts.key && opts.debug && opts?.debug()), result;
};
export function memo(fn, opts) {
let result;
return ()=>(result = fn(...newDeps), opts?.onChange?.(result), result);
}

0 comments on commit cef1be2

Please sign in to comment.