Skip to content

Instantly share code, notes, and snippets.

@Mattchewone
Last active February 12, 2019 20:34
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/635286bc0bc92fbe1b1c23dcbd4b9e98 to your computer and use it in GitHub Desktop.
Save Mattchewone/635286bc0bc92fbe1b1c23dcbd4b9e98 to your computer and use it in GitHub Desktop.
class RoomMembershipService {
async create (data, params) {
if (params.connection) {
this.app.channel(`room/${data.roomId}`).join(params.connection)
}
return data;
}
async remove (id, params) {
if (params.connection) {
this.app.channel(`room/${id}`).leave(params.connection)
}
return { id };
}
setup (app) {
this.app = app;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment