chg: dev: use namespaces for front-end #4
This commit is contained in:
13
assets/js/mine-seeker/hooks/index.js
Normal file
13
assets/js/mine-seeker/hooks/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2026 @ www.splendidbear.org
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
export { default as useGameRefs } from './useGameRefs';
|
||||
export { default as useGameState } from './useGameState';
|
||||
export { default as useServerCommunication } from './useServerCommunication';
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
/**
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2026 @ www.splendidbear.org
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
import { useRef } from 'react';
|
||||
import { PLAYER_DEF } from '../utils/constants';
|
||||
import { PLAYER_DEF } from '@mine-utils';
|
||||
|
||||
const useGameRefs = () => {
|
||||
const webPlayerRef = useRef(null);
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
/**
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2026 @ www.splendidbear.org
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
import { useState } from 'react';
|
||||
import { initCells, PLAYER_DEF } from '../utils/constants';
|
||||
import { initCells, PLAYER_DEF } from '@mine-utils';
|
||||
|
||||
const useGameState = () => {
|
||||
const [webPlayer, setWebPlayer] = useState(null);
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
/**
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2026 @ www.splendidbear.org
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { useGame } from '../contexts/GameContext';
|
||||
import { DESC } from '../utils/constants';
|
||||
import { useGame } from '@mine-contexts';
|
||||
import { DESC } from '@mine-utils';
|
||||
|
||||
/** Handles all server communication: SSE (Mercure), REST calls, and the initialization lifecycle. */
|
||||
const useServerCommunication = (gameAssoc, gameInherited, isEnvDev) => {
|
||||
|
||||
Reference in New Issue
Block a user