mirror of
https://github.com/plankanban/planka.git
synced 2025-07-30 10:39:46 +02:00
13 lines
317 B
JavaScript
13 lines
317 B
JavaScript
import { useEffect, useRef } from 'react';
|
|
|
|
export default (callback, dependencies) => {
|
|
const isMounted = useRef(false);
|
|
|
|
useEffect(() => {
|
|
if (isMounted.current) {
|
|
callback();
|
|
} else {
|
|
isMounted.current = true;
|
|
}
|
|
}, dependencies); // eslint-disable-line react-hooks/exhaustive-deps
|
|
};
|