Is it possible to conditionally run a function if both of the dependencies are changed together

Viewed 26

For following call:

useEffect(() => {
    doSomething();
},[A,B]);

If will rerun doSomething() if A or B is changed, is it possible to only rerun doSomething() if BOTH A AND B are changed and not do anything if only one of them is changed?

0 Answers
Related