2026-07-25 08:10:48 +00:00
|
|
|
// Module ID: 3746
|
|
|
|
|
// Function ID: 28598
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useShallow
|
2026-07-25 08:10:48 +00:00
|
|
|
// Dependencies: [31, 3745]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: useShallow
|
|
|
|
|
|
2026-07-25 08:10:48 +00:00
|
|
|
// Module 3746 (useShallow)
|
2026-07-23 10:11:24 +00:00
|
|
|
import result from "result";
|
|
|
|
|
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const useShallow = function useShallow(arg0) {
|
2026-07-23 10:11:24 +00:00
|
|
|
let closure_0 = arg0;
|
2026-07-20 16:05:17 +00:00
|
|
|
let closure_1 = React.useRef(undefined);
|
|
|
|
|
return (arg0) => {
|
2026-07-23 10:11:24 +00:00
|
|
|
let current = callback(arg0);
|
2026-07-20 16:05:17 +00:00
|
|
|
if (obj.shallow(ref.current, current)) {
|
|
|
|
|
current = tmp.current;
|
|
|
|
|
} else {
|
|
|
|
|
tmp.current = current;
|
|
|
|
|
}
|
|
|
|
|
return current;
|
|
|
|
|
};
|
|
|
|
|
};
|