decord/source/3804_useShallow.js

24 lines
492 B
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 3804
// Function ID: 3805
2026-07-20 16:05:17 +00:00
// Name: useShallow
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 3803]
2026-07-20 16:05:17 +00:00
// Exports: useShallow
2026-07-29 08:29:29 +00:00
// Module 3804 (useShallow)
import noop from "noop";
2026-07-23 10:11:24 +00:00
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-29 08:29:29 +00:00
let closure_1 = noop.useRef(undefined);
2026-07-20 16:05:17 +00:00
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;
};
};