time-free.openapps.xyz

Source

This app’s code and revision history are public. Download a copy or explore the files below.

Public
The app’s code and revision history are public.
Owned app · rev 4857f8a940b5
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 703ed60f2cc5ad3d98a5bf4a
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
← All files
src/lib/hooks.ts
// The current time in unix seconds, ticking every second while `on` (a running timer).
import { useEffect, useState } from "react";

export const nowSec = () => Math.floor(Date.now() / 1000);

export function useNow(on: boolean) {
  const [now, setNow] = useState(nowSec());
  useEffect(() => {
    if (!on) return;
    setNow(nowSec());
    const id = window.setInterval(() => setNow(nowSec()), 1000);
    return () => window.clearInterval(id);
  }, [on]);
  return now;
}

Change history

Point OpenApps links to openapps.free
4857f8a940 · 19 hours ago
Bind agent address constants in policy
62b1e6acb2 · 20 hours ago
Use functions.openapps.xyz alias and add OpenApp contribution strip
61d972193a · 20 hours ago
Bounded source sync
fc644b4327 · 1 day ago
Bounded source sync
22f511f3db · 1 day ago
Bounded source sync
351a8d754c · 1 day ago
Bounded source sync
0da238a77e · 1 day ago