Hacker News new | ask | show | jobs
by geuis 4789 days ago
Ok, you're just talking about plug and play. That's a separate topic about micro frameworks. What I'm asking about is a real world example where reactive programming solves a problem better than traditional techniques.

As an example, look at Promises. At first glance it seems like overkill to structure your code to return objects that get resolved later. But when you use examples of deeply nested asynchronous callback functions and how they get cleaned up with Promises, it's obvious why they are better.

What is an equivalent real-world problem where reactive programming is better?

1 comments

reactive programming is nothing except abstracting more. think about how would you define a variable and bind it to HTML. Here is my reactive way;

  JAVASCRIPT

      today = attr("Thursday")

      bind('.today', today)

      after('1s', function(){
 
        attr('Friday')

      })

  HTML

      <div class="today"></div>
      

  OUTPUT

      <div class="today">Thursday</div>

  AFTER 1S

      <div class="today">Friday</div>
This is the simplicity level I would like to achieve with minimalistic and independent modules.