title: How to listen to server(express) sent event from client(vue) instantly
body: <p>I am trying to listen to Express server sent events from my vue js client. I want to listen to it as soon as it is emitted. But it does not until the whole process is finished.</p>
  
  <p>My Express Controller Code is:</p>
  
  <pre><code>exports.getFruits = (req, res, next) =&gt; {
     const fruits = ["mango", "jackfruit", "banana", ...........];
     for(let i = 0; i &lt; fruits.length; i++){
        res.emit('fruit', fruits[i]);
     }
  };
  </code></pre>
  
  <p>From my vue client, I'm making this request</p>
  
  <pre><code>axios.get("localhost:3000/get-fruits")
  .then(res =&gt; {
     console.log(res.data);
  })
  .catch(err =&gt; {
     console.log(err);
  });
  </code></pre>
  
  <p>How can I listen to the server sent Emit instantly here? Any help would be highly appreciated.</p>