Fun & Games with Angular


Wendy Kong
Software Engineer, Pulsifi
Lead, Women Who Code KL

Made with

The challenge = handling streams

Hey, I can help!
Walkthrough
Objectives
1) Set a timer
Objectives
2) Make the items descend from the top of the screen
Objectives
3) Spawn item until time runs out or game is won
Objectives
4) Respond to click events
1) Set a timer
emit a value for every time interval
have a timer countdown
keep the interval going until timer runs out
2) Make the items descend from the top of the screen
change the y position of a single item
until it gets clicked on
...or until the game ends
3) Spawn item until time runs out or game is won
creates a random item
keep spawning until time runs out
...or until the game is won
game over clean up
4) Respond to click events
streaming click events
checking orders each time
4) Respond to click events
updating the scores
updating the order
check if all orders are completed
import from 'rxjs'
Observable ReplaySubject interval timer
import from 'rxjs/operators'
delay finalize fromEvent takeUntil tap
Thank you for listening!
Reference
learnrxjs.io
@wendko