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

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

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

  const setStoreIdFn = useCallback((val) => {
    setStoreId(val);
  }, []);

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