Browse Source

Implement Config class for the IVProg.js system

Lucas de Souza 6 years ago
parent
commit
3d83ca104b
1 changed files with 20 additions and 0 deletions
  1. 20 0
      js/util/config.js

+ 20 - 0
js/util/config.js

@@ -0,0 +1,20 @@
+let config = null;
+
+export class Config {
+
+  static get config () {
+    return config;
+  }
+
+  static setConfig(opts) {
+    config = Object.assign(config, opts);
+  }
+
+  constructor (loopTimeout, decimalPlaces, intConvertRoundMode) {
+    this.loopTimeout = loopTimeout;
+    this.decimalPlaces = decimalPlaces;
+    this.intConvertRoundMode = intConvertRoundMode;
+  }
+}
+
+config = new Config(5000, 5, 2);