This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
StasisWarden-Legacy/node_modules/zustand/esm/react/shallow.mjs
T

13 lines
312 B
JavaScript

import React from 'react';
import { shallow } from 'zustand/vanilla/shallow';
function useShallow(selector) {
const prev = React.useRef(void 0);
return (state) => {
const next = selector(state);
return shallow(prev.current, next) ? prev.current : prev.current = next;
};
}
export { useShallow };