git » hoplite.git » commit 41bffbb

prstr db

author Alan Dipert
2021-06-13 06:03:56 UTC
committer Alan Dipert
2021-06-13 06:03:56 UTC
parent 4b2bcbdf900732e7bfa98b611df027fd3c4f6b19

prstr db

hntr2.html +1 -0
hntr2.mjs +6 -6

diff --git a/hntr2.html b/hntr2.html
index adacb53..fce23c3 100644
--- a/hntr2.html
+++ b/hntr2.html
@@ -17,6 +17,7 @@
       };
       firebase.initializeApp(firebaseConfig);
     </script>
+    <script src="https://cdn.rawgit.com/beautify-web/js-beautify/v1.12.0/js/lib/beautify.js"></script>
     <script type="module" src="hntr2.mjs"></script>
   </head>
   <body>
diff --git a/hntr2.mjs b/hntr2.mjs
index 86d8406..435362f 100644
--- a/hntr2.mjs
+++ b/hntr2.mjs
@@ -8,11 +8,6 @@ let user = input(),
       // [0, "site", "foo.com"]
     ]);
 
-watch((added, removed) => {
-  console.log("added", [...added]);
-  console.log("removed", [...removed]);
-})(db);
-
 firebase.auth().onAuthStateChanged(result => {
   if (result) user.set(result)
   loaded.set(true);
@@ -62,7 +57,12 @@ function authed() {
           )
         })
       )
-    )
+    ),
+    (() => {
+      let prdb = input();
+      watch(() => prdb.set(js_beautify(JSON.stringify([...db]))))(db);
+      return $el.pre(prdb);
+    })()
   );
 }