Taming snakes with reactive streams
summary
A working snake game is built entirely with rxjs, claiming no external state by capturing all state inside streams and using scan to accumulate positions and lengths. Keyboard events feed a direction stream, an interval tick uses withLatestFrom to step the snake, collisions emit via a subject and tap to grow the snake, and the scene combines snake apples and score with combineLatest and renders at ~60fps until game over.
AI-written summary · about
chapters (10)
- 0:00Start
- 2:55WHAT IS REACTIVE?
- 3:55WHY IS IT IMPORTANT?
- 5:20RxJS brings the concept of functional reactive programming to the web
- 7:36THE GAME
- 13:49APPROACH
- 14:22BUILDING BLOCKS
- 15:01STEERING MECHANISM
- 19:15PLAYER SCORE
- 23:59SNAKE
related talks
39m"We're Snaking it Live!"
34mThe Magic of RxJS by Natalia Tepluhina (Eng) | JSConfAM19
30mThe Magic of RxJS
30mAsynchronous JavaScript
29mReactive Web Animations with RxJS
22mTaming reactive node.js: Stream-oriented architecture with NestJS
26mReactive Programming Future Proof Your Code
34mOperate Heavily Dynamic UIs with RxJS
