Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
16 lines
515 B
Plaintext
16 lines
515 B
Plaintext
import { __read } from "tslib";
|
|
import { useEffect, useState } from 'react';
|
|
import useThrottleFn from '../useThrottleFn';
|
|
import useUpdateEffect from '../useUpdateEffect';
|
|
function useThrottleEffect(effect, deps, options) {
|
|
var _a = __read(useState({}), 2), flag = _a[0], setFlag = _a[1];
|
|
var run = useThrottleFn(function () {
|
|
setFlag({});
|
|
}, options).run;
|
|
useEffect(function () {
|
|
return run();
|
|
}, deps);
|
|
useUpdateEffect(effect, [flag]);
|
|
}
|
|
export default useThrottleEffect;
|