import { useState, useCallback } from 'react';
export default function useGlobal() {
  const [alive, setAlive] = useState(false),
    [newMenus, setMenu] = useState({});

  const changealive = useCallback((parser) => {
    setAlive(parser);
  }, []);

  const setMenuFn = useCallback((val) => {
    setMenu(val);
  }, []);

  return {
    alive,
    changealive,
    newMenus,
    setMenuFn,
  };
}
