This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // a good reference on how react-hooks work https://youtu.be/KJP1E-Y-xyo | |
| // Also see brisk reconciler https://github.com/briskml/brisk-reconciler | |
| let useTimer() = hook { | |
| let! (now, setNow) = useState(0) | |
| do! useEffect1 (fun () -> | |
| let interval = setInterval 1_000 (fun () -> n+1 |> setNow) | |
| fun () -> interval.clear() | |
| ) [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fs from 'fs/promises' | |
| import satori from 'satori' | |
| let html = { | |
| type: 'div', | |
| props: { | |
| style: { | |
| height: '100%', | |
| width: '100%', | |
| display: 'flex', |
OlderNewer