April 7, 2020
This blog originally appeared on 8th Light’s blog
I’ve been intrigued by ReactiveX, in all of its programming-language variations, for a few years now. I’d see code like this:
const bricks$ = generate(1, x => x < 8, x => x + 1) .pipe( mergeMap(r => generate(r % 2 === 0 ? 1 : 0, x => x < gameSize, x => x + 2) .pipe(map(c => createGameObject(r, c))) ), toArray() ) Source: Breakout Game