class Message { constructor(messageType, peerName, peerAvatar, topic, timestamp) { this.type = messageType; this.peerName = peerName; this.peerAvatar = peerAvatar; this.topic = topic; this.timestamp = timestamp; } toJson() { return { type: this.type, name: this.peerName, avatar: this.peerAvatar, topic: this.topic, timestamp: this.timestamp }; } } export default Message;