Skip to content

Commit

Permalink
Updating docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpodwys committed May 23, 2016
1 parent 603eb87 commit c00e8b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -205,10 +205,10 @@ app.get('/events', function (req, res) {

// send a ping approx every 2 seconds
var timer = setInterval(function () {
res.write('data: ping\n\n')

// !!! this is the important part
res.flush()
res.write('data: ping\n\n', function(){
// !!! this is the important part
res.flush()
})
}, 2000)

res.on('close', function () {
Expand Down

0 comments on commit c00e8b0

Please sign in to comment.