0.1.0 (#1)
Some checks failed
Publish / publish (push) Failing after 13s
Lint / lint (push) Successful in 11s

Co-authored-by: Julien Valverdé <julien.valverde@mailo.com>
Reviewed-on: https://gitea:3000/Thilawyn/reffuse/pulls/1
This commit was merged in pull request #1.
This commit is contained in:
Julien Valverdé
2025-01-18 00:54:42 +01:00
parent 2146489fc4
commit 5430d8daa4
42 changed files with 1271 additions and 13 deletions

View File

@@ -0,0 +1,27 @@
import { R } from "@/reffuse"
import { createFileRoute } from "@tanstack/react-router"
import { Ref } from "effect"
export const Route = createFileRoute("/count")({
component: Count
})
function Count() {
const runSync = R.useRunSync()
const countRef = R.useRef(0)
const [count] = R.useRefState(countRef)
return (
<div className="container mx-auto">
{/* <button onClick={() => setCount((count) => count + 1)}> */}
<button onClick={() => Ref.update(countRef, count => count + 1).pipe(runSync)}>
count is {count}
</button>
</div>
)
}