Currently we show three users in the list, it actually do three time network request, we can verfiy this by console out each network request: var responseStream = startupRequestStream.merge(requestOnRefreshStream) .flatMap(requestUrl => { console.log…
First thing need to understand is, Reactive programming is dealing with the event stream. Event streams happens overtime, which not stay in the memory. For example, the array we have: var source = ['1', '1', 'foo', '2', '3', '5', 'bar', '8', '13']; W…
So now we want to replace one user when we click the 'x' button. To do that, we want: 1. Get the cached network data for generating the userList. 2. Then get a random user from the cached data. 3. Showing the user in the list. We have the function to…
Now we want each time we click refresh button, we will get new group of users. So we need to get the refresh button click event stream: var refreshButton = document.querySelector('.refresh'); var refreshClickStream = Rx.Observable.fromEvent(refreshBu…
In currently implemention, there is one problem, when the page load and click refresh button, the user list is not immediatly clean up,it is cleared after the new data come in. So two things we need to do, 1. Hide User Elements when the user object i…
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-1.7.2.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.0.8/rx.all.js"></script> <meta charse…
RxJS is super when dealing with the dynamic value. Let's see an example which not using RxJS: var a = 4; var b = a * 10; console.log(b); a = 5; console.log(b); So you change a, it won't affect b's value because b is already defined.... So if you want…
We will learn how to perform network requests to a backend using RxJS Observables. A example of basic jquery request: console.clear(); var requestStream = Rx.Observable.just('https://api.github.com/users'); //Current requestStream is just a stream //…
This lesson helps you think in Reactive programming by explaining why it is a beneficial paradigm for programming. See how reactive programming helps you understand the dynamic behavior of a value evolving over time. It allows you to specify the dyna…
week7中的前两节课的标题是”Actors are Distributed",讲了很多Akka Cluster的内容,同时也很难理解. Roland Kuhn并没有讲太多Akka Cluster自身如何工作的细节,而是更关注于如何利用Akka Cluster来把Actor分布到不同的节点上,或许这么安排是因为Akka Cluster能讲的东西太多,而Coursera的课时不够.但是,从听众的角度来说,这节课只是初步明白了下Akka Cluster能干啥,但是想要自己用起来,特别是想了解其工作的…