PHP 7.4.33
Preview: shallow.js Size: 350 B
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/zustand/react/shallow.js
'use strict';

var React = require('react');
var shallow = require('zustand/vanilla/shallow');

function useShallow(selector) {
  const prev = React.useRef(undefined);
  return (state) => {
    const next = selector(state);
    return shallow.shallow(prev.current, next) ? prev.current : prev.current = next;
  };
}

exports.useShallow = useShallow;

Directory Contents

Dirs: 0 × Files: 2
Name Size Perms Modified Actions
86 B lrw-r--r-- 2025-03-28 11:04:34
Edit Download
350 B lrw-r--r-- 2025-03-28 11:04:34
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).