MCPcopy Create free account
hub / github.com/Milkyroad/SCiPNET / fetchVisitorCount

Function fetchVisitorCount

public/src/js/script.js:380–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

378
379//fetch and update visitor count with firestore
380function fetchVisitorCount() {
381 firebase
382 .firestore()
383 .collection("general")
384 .doc("count")
385 .get()
386 .then((doc) => {
387 $("#visitors").text(doc.data().count);
388 })
389 .catch((error) => {
390 $("#visitors").text(error).css("color", "#EA3546");
391 });
392}
393if (localStorage.getItem("count") == null) {
394 firebase
395 .firestore()

Callers 1

script.jsFile · 0.85

Calls 3

$Function · 0.50
getMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected