Web.js - Classes

This section covers the classes in the web.js file.

In This Section

WebController

The WebController class does all the interactions with the page and displays the associated content. Since this class is the most important part of this help documentation, we divided the content in several sections:

Fibonacci

The Fibonacci class is used for the reconnection logic if a disconnection occurs.

class Fibonacci {
  constructor() {
    this.reset();
  }
  reset() {
    this.first = 0;
    this.second = 1;
  }
  next() {
    const next = this.first + this.second;
    this.first = this.second;
    this.second = next;
    return next;
  }
  get() {
    return this.first + this.second;
  }
}

In the web.js file, you’ll find that each section described begins with an easy-to-find comment which contains the section name.