feat : allow custom starting fen
This commit is contained in:
@@ -14,9 +14,12 @@ export const useChessActions = (chessAtom: PrimitiveAtom<Chess>) => {
|
||||
[setGame]
|
||||
);
|
||||
|
||||
const reset = useCallback(() => {
|
||||
setGame(new Chess());
|
||||
}, [setGame]);
|
||||
const reset = useCallback(
|
||||
(fen?: string) => {
|
||||
setGame(new Chess(fen));
|
||||
},
|
||||
[setGame]
|
||||
);
|
||||
|
||||
const copyGame = useCallback(() => {
|
||||
const newGame = new Chess();
|
||||
|
||||
Reference in New Issue
Block a user