63 lines
3.5 KiB
TypeScript
63 lines
3.5 KiB
TypeScript
/* Metro module 10898; source: hooks/useThrottle.tsx; dependencies: [31, 22, 2] */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as Module00022Module from '../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import * as ReactModule from '../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
|
|
function _fun83440(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11084:6, offset: 0x01f1a755, size: 144 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const throttleStateFn = function(a0) {
|
|
return a0;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const useThrottledFunction2 = useThrottledFunction;
|
|
(FileImportTrackerModule).fileFinishedImporting('hooks/useThrottle.tsx');
|
|
exports.useThrottledState = useThrottledState;
|
|
exports.useThrottledFunction = useThrottledFunction2;
|
|
function useThrottledFunction(a0, a1) { // fn#83442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11084:168, offset: 0x01f1a7e5, size: 148 bytes, params: 3, frame: 21
|
|
let value = a2;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const r6 = value !== undefined ? value : [];
|
|
const binding = a3;
|
|
value = binding.useRef(Reflect.apply(require(dependencyMap[1]).throttle, value, [a0, a1, a3]));
|
|
const useEffect = binding.useEffect;
|
|
const items2 = [a0, a1, a3];
|
|
arraySpread(items2, r6, 3, dependencyMap);
|
|
Reflect.apply(useEffect, binding, [_fun83443, items2]);
|
|
return value.current;
|
|
function _fun83443() { // fn#83443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11084:243, offset: 0x01f1a879, size: 74 bytes, params: 1, frame: 16
|
|
const binding = env0_3;
|
|
binding.current = Module00022Module.throttle(env0_0, require, importAll);
|
|
return _fun83444;
|
|
function _fun83444() { // fn#83444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11084:282, offset: 0x01f1a8c3, size: 32 bytes, params: 1, frame: 9
|
|
const current = env1_3.current;
|
|
if (current != null) {
|
|
current.cancel();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useThrottledState(a0, a1) { // fn#83445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11084:428, offset: 0x01f1a8e3, size: 124 bytes, params: 3, frame: 20
|
|
const value = a0;
|
|
const value2 = a2;
|
|
const r8 = value2 !== undefined ? value2 : [];
|
|
const env0_2 = undefined;
|
|
const value4 = useThrottledFunction(throttleStateFn, a1, r8, a3);
|
|
const binding = env0_2;
|
|
const value5 = binding.useRef(value);
|
|
binding.useEffect(_fun83446, [value, value4]);
|
|
return a1 === 0 ? value : value5.current;
|
|
function _fun83446() { // fn#83446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11084:527, offset: 0x01f1a95f, size: 30 bytes, params: 1, frame: 12
|
|
env0_2.current = env0_1(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun83440, 10898, [31, 22, 2]) /* metro module 10898, dependencies: [31, 22, 2] */;
|