title: Reactive programming with Javascript
body: <p>I m new in reactive programming and I m a bit lost reading all these articles that I can't understand.</p>
  
  <p>Actually, I m a javascript developer from Nodejs, Angularjs, Angular 2 and React.</p>
  
  <p><strong>What I do</strong></p>
  
  <p>I use promises all the time, for remote data fetching, local async resolution etc... Better testability than callbacks and fit my needs.</p>
  
  <p><strong>What I understand using streams</strong></p>
  
  <p>I can't figure out where streams can save me except in a particular case.</p>
  
  <p>This special case, is that I can't use promises while listening on streams because the promise would be resolved only once. </p>
  
  <p>An example with SocketIo: </p>
  
  <pre><code>io.on('connection',  (socket) =&gt; {
    // this works
  });
  
  io.on('connection').then((socket) =&gt; {
    // this can't work, promise would be resolved only once
  });
  </code></pre>
  
  <p>If I m not wrong, I could use reactive streams to manage this case by simply returning an observable. Right ?</p>
  
  <p><strong>What I don't understand</strong></p>
  
  <p>I m studying Angular 2 and all the stuff around. Actually, from many blogs, people use to use observables to fetch remote data and I can't understand what could be an advantage of using it instead of promises.</p>
  
  <p>The fact is that I would need to make a remote like in both cases, so why more one than the other ? Is this a performance issue ?</p>
  
  <p><strong>What I need</strong></p>
  
  <p>If you've read the whole question, what I need is to understand what are the advantages of using reactive programming instead of promises in the case of remote data fetching ?</p>
  
  <p>In which (other cases) could it be better to use reactive stuff than usual stuff ?</p>