import { Injectable } from '@nestjs/common' ; import { User } from './interfaces/user' ; @ Injectable ( ) export class ChatService { rooms : string [ ] = [ ] ; connectedUsers : User [ ] = [ ] ; addConnectedUser ( user ) { this . connectedUsers . push ( user ) ; } removeConnectedUser ( user ) { this . connectedUsers = this . connectedUsers . filter ( ( obj ) => obj !== user ) ; } }