apollographql / graphql-subscriptions

:newspaper: A small module that implements GraphQL subscriptions for Node.js
MIT License
1.59k stars 133 forks source link

doc: update demo code #208

Closed hongbo-miao closed 5 years ago

hongbo-miao commented 5 years ago

Not a big thing. Based on above context

const listenToNewMessages = (callback) => {
  return db.table('messages').listen(newMessage => callback(newMessage));
}

// Kick off the listener
listenToNewMessages(message => {
  console.log(message);
})

listenToNewMessages is a better fit.

grantwwu commented 5 years ago

Thanks for the catch!