0.1.6 (#9)
All checks were successful
Publish / publish (push) Successful in 29s
Lint / lint (push) Successful in 13s

Co-authored-by: Julien Valverdé <julien.valverde@mailo.com>
Reviewed-on: https://gitea:3000/Thilawyn/reffuse/pulls/9
This commit was merged in pull request #9.
This commit is contained in:
Julien Valverdé
2025-04-12 23:58:25 +02:00
parent d7c648994d
commit 4092da0f0c
15 changed files with 320 additions and 268 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@reffuse/extension-lazyref",
"version": "0.1.1",
"version": "0.1.2",
"type": "module",
"files": [
"./README.md",
@@ -37,6 +37,6 @@
"@types/react": "^19.0.0",
"effect": "^3.13.0",
"react": "^19.0.0",
"reffuse": "^0.1.4"
"reffuse": "^0.1.6"
}
}

View File

@@ -1,12 +1,12 @@
import * as LazyRef from "@typed/lazy-ref"
import { Effect, Stream } from "effect"
import * as React from "react"
import { ReffuseExtension, type ReffuseHelpers, SetStateAction } from "reffuse"
import { ReffuseExtension, type ReffuseNamespace, SetStateAction } from "reffuse"
export const LazyRefExtension = ReffuseExtension.make(() => ({
useLazyRefState<A, E, R>(
this: ReffuseHelpers.ReffuseHelpers<R>,
this: ReffuseNamespace.ReffuseNamespace<R>,
ref: LazyRef.LazyRef<A, E, R>,
): [A, React.Dispatch<React.SetStateAction<A>>] {
const initialState = this.useMemo(() => ref, [], { doNotReExecuteOnRuntimeOrContextChange: true })