Util fn in gun test file

This commit is contained in:
Daniel Lugo 2021-05-05 08:37:28 -04:00
parent b2576a8147
commit 48af24fd3d

View file

@ -7,7 +7,7 @@
<title>Document</title> <title>Document</title>
</head> </head>
<body> <body>
</body> </body>
<script src="node_modules/gun/gun.js"></script> <script src="node_modules/gun/gun.js"></script>
<script src="node_modules/gun/sea.js"></script> <script src="node_modules/gun/sea.js"></script>
@ -34,6 +34,12 @@
const UPPER = 100 const UPPER = 100
clearSet = (node) => {
node.map().once((_, key) => {
node.get(key).put(null)
})
}
put = async () => { put = async () => {
const res = await fetch(`https://jsonplaceholder.typicode.com/posts`) const res = await fetch(`https://jsonplaceholder.typicode.com/posts`)
/** @type {Array<any>} */ /** @type {Array<any>} */
@ -55,7 +61,7 @@
}) })
}) })
} }
</script> </script>
<style> <style>