mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-15 08:15:37 +00:00
WIP: Implement config in Frontend
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import {useEffect, useRef} from "react";
|
||||
|
||||
export default function useUpdateEffect(effect: Function, dependencies?: [any]) {
|
||||
const isInitialMount = useRef(true);
|
||||
|
||||
useEffect(() => {
|
||||
if (isInitialMount.current) {
|
||||
isInitialMount.current = false;
|
||||
} else {
|
||||
return effect();
|
||||
}
|
||||
}, dependencies);
|
||||
}
|
||||
Reference in New Issue
Block a user