DEV Community

loading...

Discussion on: RxJS Simplified (don't lose your marbles)

Collapse
fedelway profile image
Federico Perez

Nice explaination. I really liked the marble machine analogies.

This piece of code was a little bit confusing for me when I first read it:

marbleMachine.pipe(
  filter((marble) => ['green', 'red'].indexOf(marble) > -1)
).subscribe(
Enter fullscreen mode Exit fullscreen mode

Probably using Array method contains makes it a little bit easier to understand without losing focus on the important stuff: RxJs

Collapse
jmdejager profile image
🐤🥇 Jasper de Jager Author

Thnx!
And good point. I'll change this to something more easy to read. Thanks for the help 🙂