Search⌘ K

The RxJS Backbone

Learn how to build the RxJS backbone for reactive game development by managing game state updates, animations, and rendering frames with custom operators and safe side effects. Understand using interval, animationFrame scheduler, mapTo, and tap operators to create an efficient game loop. Discover the importance of Object.assign for state references and gain skills to control render order on canvas effectively.

First step down! Now, on to interactivity and animations.

The RxJS backbone

For a game to work, every frame, we need to go through every item in the game, make any changes to the item’s state, and then render everything on the page.

Custom operators and tap operator in games

RxJS lets us declaratively state each step through custom operators and tap.

Our custom operators take in the entire observable, so each item has the complete ...