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
12 lines
402 B
Plaintext
12 lines
402 B
Plaintext
import { useRef } from 'react';
|
|
import { depsEqual } from '../utils/depsEqual';
|
|
export var createDeepCompareEffect = function (hook) { return function (effect, deps) {
|
|
var ref = useRef(undefined);
|
|
var signalRef = useRef(0);
|
|
if (deps === undefined || !depsEqual(deps, ref.current)) {
|
|
signalRef.current += 1;
|
|
}
|
|
ref.current = deps;
|
|
hook(effect, [signalRef.current]);
|
|
}; };
|