Duffer Derek

Current Path : /var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/zustand/react/
Upload File :
Current File : /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;

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists