Reactive Programming with RxJS 5: Untangle Your Asynchronous JavaScript Code by Sergi Mansilla

Reactive Programming with RxJS 5: Untangle Your Asynchronous JavaScript Code by Sergi Mansilla

Author:Sergi Mansilla [Mansilla, Sergi]
Language: eng
Format: epub, azw3, mobi, pdf
Tags: Pragmatic Bookshelf
Publisher: Pragmatic Bookshelf
Published: 2018-02-04T23:00:00+00:00


const Game = Observable.combineLatest(StarStream, SpaceShip, (

stars,

spaceship

) => ({

stars,

spaceship

}));

Game.subscribe(renderScene);

We’re now using a function renderScene to paint everything on the screen, so you can remove the following subscription code for StarStream:

.subscribe(function(starArray) {

paintStars(starArray);

});

With this, we’ll paint the starry background and the spaceship every time any Observable emits a new item. We now have a spaceship flying through space, and we can move it at will using our mouse. Not bad for so little code! But our hero’s spaceship is too lonely in the vastness of space. What about giving it some company?



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.