Explorar el Código

Add debugging state as toggle

Kirk Trombley hace 3 años
padre
commit
b8775295cc
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  1. 10 0
      web/listeners.js

+ 10 - 0
web/listeners.js

@@ -1,6 +1,16 @@
+const DEBUG_MODE = false;
+
 // Search
 const { rerenderSearch, onSearch, onRandomName } = (() => {
   let results;
+  if (DEBUG_MODE) {
+    // set of some pokemon with interesting edge cases
+    starting = [
+      "latias", "wailmer", "luxray", "seaking", "blastoise", "oranguru", "blacephalon", "crustle", "rolycoly"
+    ];
+    starting.forEach(x => clusterToggles[`${x}-search-pkmn-expand-toggle`] = true)
+    results = pokemonData.filter(p => starting.includes(p.name));
+  }
   const pokemonLookup = new Fuse(pokemonData, { keys: [ "name" ] });
 
   const rerenderSearch = state => {