Tests
Some checks failed
Lint / lint (push) Failing after 9s

This commit is contained in:
Julien Valverdé
2025-01-10 22:34:53 +01:00
parent 00bf5a3c63
commit 5f455295ad
2 changed files with 13 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
import { Ref } from "effect"
import "./App.css"
import reactLogo from "./assets/react.svg"
import { Reffuse } from "./Reffuse"
@@ -6,7 +7,10 @@ import viteLogo from "/vite.svg"
export function App() {
const [count, setCount] = Reffuse.useRefState(Reffuse.useRef(0))
const runtime = Reffuse.useRuntime()
const countRef = Reffuse.useRef(0)
const [count] = Reffuse.useRefState(countRef)
return <>
@@ -20,7 +24,8 @@ export function App() {
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
{/* <button onClick={() => setCount((count) => count + 1)}> */}
<button onClick={() => Ref.update(countRef, count => count + 1).pipe(runtime.runSync)}>
count is {count}
</button>
<p>