1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/web/static/js/store/actions.js
2016-12-10 19:35:01 +01:00

26 lines
406 B
JavaScript

const SET_BOARD = "SET_BOARD";
const SELECT_PIECE = "SELECT_PIECE";
const MOVE_PIECE = "MOVE_PIECE";
export const setBoard = (board) => {
return {
type: SET_BOARD,
board: board
}
}
export const selectPiece = (coords) => {
return {
type: SELECT_PIECE,
coords: coords
};
}
export const movePiece = (from, to) => {
return {
type: MOVE_PIECE,
from: from,
to: to
};
}