@reffuse/extension-query 0.1.4 #15
@@ -12,13 +12,12 @@ function Count() {
|
||||
const runSync = R.useRunSync()
|
||||
|
||||
const countRef = R.useRef(() => Effect.succeed(0))
|
||||
const [count] = R.useRefState(countRef)
|
||||
const [count] = R.useSubscribeRefs(countRef)
|
||||
|
||||
|
||||
return (
|
||||
<div className="container mx-auto">
|
||||
{/* <button onClick={() => setCount((count) => count + 1)}> */}
|
||||
<button onClick={() => Ref.update(countRef, count => count + 1).pipe(runSync)}>
|
||||
<button onClick={() => runSync(Ref.update(countRef, count => count + 1))}>
|
||||
count is {count}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user