Fix linting and build errors.
This commit is contained in:
parent
d8d05589e7
commit
36e1ea45d5
9 changed files with 94 additions and 45 deletions
|
|
@ -9,6 +9,7 @@ import {
|
|||
ID_ACTION_STARTED_LOADING,
|
||||
ID_ACTION_TOGGLED_SHOW_SOLUTION
|
||||
} from "./action.ts";
|
||||
import Maze from "@/app/model/maze.ts";
|
||||
|
||||
export default function reduce(state: State, action: Action): State {
|
||||
switch (action.type) {
|
||||
|
|
@ -24,7 +25,7 @@ export default function reduce(state: State, action: Action): State {
|
|||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
maze: action.maze,
|
||||
maze: action.maze as Maze,
|
||||
userPath: []
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +39,7 @@ export default function reduce(state: State, action: Action): State {
|
|||
case ID_ACTION_TOGGLED_SHOW_SOLUTION: {
|
||||
return {
|
||||
...state,
|
||||
showSolution: action.value
|
||||
showSolution: action.value as boolean
|
||||
}
|
||||
}
|
||||
case ID_ACTION_CLOSED_MESSAGE_BANNER: {
|
||||
|
|
@ -49,7 +50,7 @@ export default function reduce(state: State, action: Action): State {
|
|||
}
|
||||
case ID_ACTION_CLICKED_CELL: {
|
||||
// There's so much logic involved, externalize that into its own file.
|
||||
return handleUserClicked(state, action.x, action.y);
|
||||
return handleUserClicked(state, action.x as number, action.y as number);
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unknown action: ${action.type}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue