MCPcopy
hub / github.com/statelyai/xstate / createInitialContext

Function createInitialContext

examples/snake-react/src/snakeMachine.ts:116–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114}
115
116export function createInitialContext(): SnakeMachineContext {
117 const gridSize: Point = { x: 25, y: 15 };
118 return {
119 gridSize,
120 snake: makeInitialSnake(gridSize),
121 apple: makeInitialApple(gridSize),
122 score: 0,
123 highScore: 0,
124 dir: 'Right'
125 };
126}
127
128export const snakeMachine = setup({
129 types: {

Callers 1

snakeMachine.tsFile · 0.85

Calls 2

makeInitialSnakeFunction · 0.85
makeInitialAppleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…