Web.js - クラス

ここでは web.js ファイル内のクラスについて説明します。

In This Section

WebController

WebController は、適切にコンテンツを表示し、ページ上のすべてのアクションを処理します。この class は、このヘルプドキュメントの中で最も重要なものであるため、いくつかのセクションに分けて説明します。

Fibonacci

Fibonacci クラスは切断が発生した場合の再接続ロジックに使用します。

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;
  }
}

web.js ファイルでは、各セクションの冒頭部に、セクション名を含む、分かりやすいコメントが記述されています。