Am I correct in thinking that the sessionStorage
will persist as long as the websocket connection remains open with npm run dev
running in the Terminal? I can reload pages, close the browser window, and even create a new user connection, and old messages will still be loaded.
Here is my MessageStore (sorry for the formatting):
export class MessageStore extends Store {
constructor(key) {
super(sessionStorage);
this.key = key;
}
}
I added this to the end of drawMessage
in dom.js
, after the scrollIntoView();
…
var array = $.makeArray(this.$list);
return array;
…to make use of these statements in the ChatApp
class in app.js
:
let message = new ChatMessage(data);
messageList = this.chatList.drawMessage(message.serialize());
messageStore.set(messageList);
Does this make sense? Is it behaving properly?