Reference
React hooks
import { … } from "@johnmorrisdotca/tane/react";
10.5 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
DailySeed | type | Today, as useDailySeed hands it back: the day written YYYY-MM-DD, and its seed. |
useDailySeed | function | Today's day and seed, which change on their own at midnight in timeZone (UTC unless named): a page left open overnight moves to the new day's puzzle without a reload. |
useSeeded | function | Something made once from a seeded stream, and made again only when the seed changes: useSeeded(seed, (random) => shuffled(random, deck)). |