mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 10:20:16 +01:00
Remove out of zone penality + upgrades
This commit is contained in:
15
traque-front/hook/useLocalVariable.jsx
Normal file
15
traque-front/hook/useLocalVariable.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
export default function useLocalVariable(variable, setVariable) {
|
||||
const [localVariable, setLocalVariable] = useState(variable);
|
||||
|
||||
useEffect(() => {
|
||||
setLocalVariable(variable);
|
||||
}, [variable]);
|
||||
|
||||
function applyLocalVariable() {
|
||||
setVariable(localVariable);
|
||||
}
|
||||
|
||||
return [localVariable, setLocalVariable, applyLocalVariable];
|
||||
}
|
||||
Reference in New Issue
Block a user