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

This commit is contained in:
Julien Valverdé
2025-01-10 22:11:50 +01:00
parent 100169952c
commit 64c07a62e6
2 changed files with 15 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
import { Console } from "effect"
import { useState } from "react"
import "./App.css"
import reactLogo from "./assets/react.svg"
import { Reffuse } from "./Reffuse"
@@ -6,7 +8,11 @@ import viteLogo from "/vite.svg"
export function App() {
const [count, setCount] = Reffuse.useRefState(Reffuse.useRef(0))
Reffuse.runSync(Console.log("test"))
// const [count, setCount] = Reffuse.useRefState(Reffuse.useRef(0))
const [count, setCount] = useState(0)
return <>
<div>

View File

@@ -7,12 +7,15 @@ export class Reffuse<R, ER> {
constructor(
private readonly runtime: ManagedRuntime.ManagedRuntime<R, ER>
) {
this.Context = React.createContext(runtime)
const Context = React.createContext(runtime)
this.Context = Context
this.Provider = (props: { readonly children?: React.ReactNode }) => this.Context({
...props,
value: this.runtime,
})
this.Provider = (props: { readonly children?: React.ReactNode }) => (
<Context
{...props}
value={runtime}
/>
)
}
readonly Context: React.Context<ManagedRuntime.ManagedRuntime<R, ER>>