"use strict";

function ActiveUsersComponent(target, topicId) {
  this.targetElement = target;
  this.topicId = topicId;
}

ActiveUsersComponent.prototype.render = function () {
  getActiveUsers(this.topicId, (data) => {
    let userNameDivs = appendUserNames(...data.userNames);
    
    appendToSidebar(this.targetElement, userNameDivs);
  });
};
"use strict";

function ActiveUsersComponent(target, topicId) {
  this.targetElement = target;
  this.topicId = topicId;
}

ActiveUsersComponent.prototype.render = function () {
  getActiveUsers(this.topicId, (data) => {
    let userNameDivs = appendUserNames(...data.userNames);
    
    appendToSidebar(this.targetElement, userNameDivs);
  });
};

// Create new component
let component = new ActiveUsersComponent(".active-users", 17);

component.render();
Create a new instance of ActiveUsersComponent. Call render method
Create a new instance of ActiveUsersComponent. Call render method
