0.1.0 #1
@@ -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>
|
||||
|
||||
@@ -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>>
|
||||
Reference in New Issue
Block a user