Skip to content

Instantly share code, notes, and snippets.

@Mattchewone
Created February 12, 2019 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mattchewone/eb415c18790142f24659fc1c667fda03 to your computer and use it in GitHub Desktop.
Save Mattchewone/eb415c18790142f24659fc1c667fda03 to your computer and use it in GitHub Desktop.
const service = app.service('messages')
service.hooks(hooks)
// Publish events
service.publish((data, context) => {
// Filter the channels to only authenticated
return app.channel(`room/${data.roomId}`)
.filter(connection => connection.user._id.toString() !== data.userId.toString())
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment