canUndofunction
Whether undo is enabled and a recorded move can be removed.
Import it
import { canUndo } from "@johnmorrisdotca/narabe";
Definition
function canUndo(state: GameState): boolean
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The current immutable game position. |
Returns
boolean
Whether undo is enabled and a recorded move can be removed.
Examples
import { canUndo, createGame } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
console.log(canUndo(state));falseWhat it prints (run when this page was built)