mylingo3d
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
15 lines • 501 B
JavaScript
import { useState, useEffect } from "preact/hooks";
export default (setGlobalState, getGlobalState) => {
const useGlobalState = () => {
const [state, setState] = useState(() => getGlobalState());
useEffect(() => {
const handle = getGlobalState(setState);
return () => {
handle.cancel();
};
}, []);
return [state, setGlobalState];
};
return useGlobalState;
};
//# sourceMappingURL=hook.js.map