Files
rust_imgapi/admin-panel/node_modules/zustand/esm/react/shallow.mjs
Beyhan Oğur dd72c6220d first commit
2026-04-26 22:32:52 +03:00

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 };