title: Expose return value
body: <p>I have this piece of code that I am working on. To provide context, I am using an event source to stream an server sent event. Once I receive the data/response I want to pass that into my template(handlebars) view. The code below is a GET request in which I am trying to display the data returned from SSEvents.addEventListener.</p>
  
  <pre><code>method: 'GET',
  path: '/students',
  config: {
  handler: (request, reply) =&gt; {
    SSEvents.addEventListener('score', function(e) {
      const data = JSON.parse(e.data);
      }, false);
        reply.view('students', {result: data});
     },
      description: "Endpoint lists all users that have received at least one test score.",
      tags: ['api']
     }
   }
  </code></pre>
  
  <p>The issue with this code is the constant "data" is not available outside of the scope of the event listener. I need to find a way to expose the constant so that I can use it in reply.view('students', {result: data});</p>
  
  <p>NOTE: I have tried adding "reply.view('students', {result: data});" within the event listener and it throws the following error: reply interface called twice.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>--Thanks!</p>