MCPcopy Index your code
hub / github.com/python-websockets/websockets / sendMoves

Function sendMoves

example/tutorial/step1/main.js:29–43  ·  view source on GitHub ↗
(board, websocket)

Source from the content-addressed store, hash-verified

27}
28
29function sendMoves(board, websocket) {
30 // When clicking a column, send a "play" event for a move in that column.
31 board.addEventListener("click", ({ target }) => {
32 const column = target.dataset.column;
33 // Ignore clicks outside a column.
34 if (column === undefined) {
35 return;
36 }
37 const event = {
38 type: "play",
39 column: parseInt(column, 10),
40 };
41 websocket.send(JSON.stringify(event));
42 });
43}
44
45window.addEventListener("DOMContentLoaded", () => {
46 // Initialize the UI.

Callers 1

main.jsFile · 0.70

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…