drashland/wocket

client.js - create Message class

crookse opened this issue · 1 comments

class Message {
  constructor(message) {
    this.encoder = new TextEncoder();
    this.message = message;
  }

  toBinary() {
  }

  toJson() {
  }
}

All messages received by the server should be converted to a Message object. For example:

let message = new Message(messageFromServer);

Closing this. We can revisit these issues in https://github.com/drashland/sockets-client if needed.