async unsubscribeFromChatMessages(id, userId, unsubscribeFunction) {
    if (typeof unsubscribeFunction !== 'function') {
      throw new ChatError('invalid-unsubscribe-function', 'only can unsubscribe using a function');
    }

    unsubscribeFunction();
  }
/**
   * Unsubscribe from messages belonging to a chat
   * @param {string} id The id of the chat
   * @param {string} userId The id of the user
   * @param {function} unsubscribeFunction The function to unsubscribe to. It is the function that is returned when subscribing to the chat messages
   * @throws {ChatError}
   */
Unsubscribe from messages belonging to a chat
@param {string} id The id of the chat
@param {string} userId The id of the user
@param {function} unsubscribeFunction The function to unsubscribe to. It is the function that is returned when subscribing to the chat messages
@throws {ChatError}
Unsubscribe from messages belonging to a chat @param { string } id The id of the chat @param { string } userId The id of the user @param { function } unsubscribeFunction The function to unsubscribe to . It is the function that is returned when subscribing to the chat messages @throws { ChatError }
async unsubscribeFromChatMessages(id, userId, unsubscribeFunction) {
    if (typeof unsubscribeFunction !== 'function') {
      throw new ChatError('invalid-unsubscribe-function', 'only can unsubscribe using a function');
    }
    unsubscribeFunction();
  }
async unsubscribeFromChatMessages ( id , userId , unsubscribeFunction ) { if ( typeof unsubscribeFunction !== 'function' ) { throw new ChatError ( 'invalid-unsubscribe-function' , 'only can unsubscribe using a function' ) ; } unsubscribeFunction ( ) ; }
Unsubscribe from messages belonging to a chat
 @param {string} id The id of the chat
 @param {string} userId The id of the user
 @param {function} unsubscribeFunction The function to unsubscribe to.
Unsubscribe from messages belonging to a chat @param { string } id The id of the chat @param { string } userId The id of the user @param { function } unsubscribeFunction The function to unsubscribe to .